Replace Comma(,) with Dot(.) RegEx php

前端 未结 5 1198
遇见更好的自我
遇见更好的自我 2021-01-02 01:24

i am trying this code but i get this error: No ending delimiter \'/\' found

$form = \" 2000,50\";
$salary = preg_replace(\'/\',\', \'.\'/\', $f         


        
5条回答
  •  情话喂你
    2021-01-02 02:10

    $salary = preg_replace('/,/', '.', $form);
    

    But yeah, you don't really want to match a pattern but a string which is constant, so simply use str_replace().

提交回复
热议问题