I have some strings like these:
$str = "it is a test,it is a test";
$str = "it is a test ,it is a test";
$str = "it is a test, it is a test";
$str = "it is a test , it is a test";
Now I want this for all of them:
$str = "it is a test, it is a test";
Now, I can do that in several steps:
str_replace(" , ",",","$str");
str_replace(" ,",",","$str");
str_replace(", ",",","$str");
str_replace(",",", ","$str");
Then the output will be what I want. Now I want to know, is there any REGEX code for doing that in one step?