Hi there!
I have a cb_city field in user's profile. Sometimes users enter their city data as: "Moscow,Tula,Smolensk" (without spaces after brackets).
My goal is to put a little PHP code that will replace every "\S,\S" by a "\s,\s" (we talk about preg_replace function, to
put spaces around commas in this sting). But it doesn't change anything.
So in this field inside "integration" tab under "CB Code Field" I enter the following code:
Code:
$string = '[value]';
$pattern = '/\S,\S/';
$replacement = ' , ';
return preg_replace($pattern, $replacement, $string);
What's wrong here?