My head is spinning, I tried to do this on my own, but cant figure it out. so once again I will turn to your guys knowledge.
These all are my possible my strings:
My head is spinning with, pregreplace
My head is spinning, with, pregreplace
My head is, spinning, with, pregreplace
My head, is, spinning, with, pregreplace
(Notice commas in above strings)
I want to have all "preg-replaced" / "string-replaced" with only one comma at the end.(Just like displayed on first example)
My head is spinning with, pregreplace
Thanks in advance ;)
strrpos
,substr
,str_replace
, that's all.