I currently have the string:
"Blah, blah, blah,~Part One, Part Two~,blah blah"
I need to remove the comma between the ~
character so it reads.
"Blah, blah, blah,~Part One Part Two~,blah blah"
Can anyone help me out please?
Many thanks,
I currently have the string:
"Blah, blah, blah,~Part One, Part Two~,blah blah"
I need to remove the comma between the ~
character so it reads.
"Blah, blah, blah,~Part One Part Two~,blah blah"
Can anyone help me out please?
Many thanks,
If there is exactly one comma between the ~
s and an even number of ~
s in all, then
preg_replace("/~([^,]*),([^,]*)~/", "~\1\2~", $text)
should do it.