preg_replace causing dollar signs get removed

后端 未结 5 656
春和景丽
春和景丽 2020-12-19 05:52

I have an email system, where user write a message and it will send the message. The main problem which I just found, consider this code

    $findEmail = $th         


        
5条回答
  •  盖世英雄少女心
    2020-12-19 06:18

    Guess your template just includes "pure" PHP and tries to use $74 as variable, which does not exist and does not hold any data. So change the quotes in the template to single quotes '.

    guessed template:

    $tpl = "Sum: $74.97"; //results in "Sum: .97"
    

    corrected template:

    $tpl = 'Sum: $74.97'; //results in "Sum: $74.97"
    

提交回复
热议问题