The "/" in your line is used as the delimiter of the beginning of the regular expression, so you need to avoid it. The correct line should look like this:
$salary = preg_replace('\\/',', '.'/', $form);
I am also curious why the second parameter is ",". '/', but not ',/'.
EDIT
Ahh Now I see the line should read:
$salary = preg_replace( '/,/', '.', $form);
I was confused because the first comma in your example should be ".". to concatenate a string.
source share