views:

123

answers:

2

hello. im trying to echo mediaplayer embed code with IF statement. is there any way to replace all quotation marks (") with (\")'s ?

thank you..

+4  A: 

As comments and other answers indicate your question may not be quite explicit enough. Taking it at face value, if you just want to replace double quotes (") you should use str_replace()

str_replace('"', '\"', $string);
Yacoby
+2  A: 

addslashes will do the trick.

It will return a new string with the all the quotes ( ' and " ) with their escaped counterparts.

Jacob Relkin