How to avoid escaping double quotes and single quotes in php -


i sure there must better way putting backslash (\) escape double quotes in php

suppose have following

 <param name="flashvars" value="config={clip:{autoplay:true,autohide..... 

the value consist of many " , ' , getting tedious adding \ before every "

you can use addslashes in case. don't use queries database though. use specific escape functions that.

$param = "config={clip:autoplay:true,autohide..."; // put full value here 

and in html:

<param name="flashvars" value="<?php echo addslashes($param) ?>"> 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -