I need to use the str_replace function for a php-script which works
together with html/javascript.
In the script I have to perform things like:
$arabic=str_rep lace ("'","\'", $row[0]);
$arabic=str_rep lace ("sh", "\š", $row[0]);
the second line works perfectly, however I can't make the first one
work, it should replace a single quote with a quote preceded by a
backslash. I presume I have to escape some characters to make this
happen however I can't figure out how.
any help welcome
best regards,
Hugo
b.t.w. I can't use the htmlspecialchar s-function as this will interfere
with other code in the script
together with html/javascript.
In the script I have to perform things like:
$arabic=str_rep lace ("'","\'", $row[0]);
$arabic=str_rep lace ("sh", "\š", $row[0]);
the second line works perfectly, however I can't make the first one
work, it should replace a single quote with a quote preceded by a
backslash. I presume I have to escape some characters to make this
happen however I can't figure out how.
any help welcome
best regards,
Hugo
b.t.w. I can't use the htmlspecialchar s-function as this will interfere
with other code in the script
Comment