Saturday 15 March 2014

php - Replace character with special characters -



php - Replace character with special characters -

i have :

$x = "#frac {2} {3}";

i seek code doesnt work:

$x = str_replace("#","\"",$x);

i want replace # with \ in string. cant utilize str_replace.

any help?

you replacing # " utilize backslash in string need escape it. how create string in php backslash in it?

$x = "#frac {2} {3}"; $x = str_replace("#", "\\", $x);

php

No comments:

Post a Comment