i am trying this code but i get this error: No ending delimiter \'/\' found
$form = \" 2000,50\";
$salary = preg_replace(\'/\',\', \'.\'/\', $f
I don't understand your parameters -- I'm not sure what's supposed to be in the string and what isn't. But for preg_replace, the search pattern should be a string, and with the string also begin and end with a delimiter (typically '/'). I think it's redudant to need slashes round the search string when it's already inside a string, but that's how it works.
The second parameter should be a string containing the full stop and nothing else. This gives:
$salary = preg_replace( '/,/' , '.' , $form);
Other people are correct that str_replace will be fine for turning one character into another, but if the replacement you want gets more complicated preg_replace will be reasonable.