Mohammad Mohammad - 1 year ago 73
PHP Question

How can set two ' (apostrophe) together in echo

I have this code :

echo ' <style> #post_sx {background:url('../images/posts/T_P1.png') right center no-repeat;} </style>';

character after echo and
character in background url address can't be together I forgot how can solve this?

and when I use :

echo ' <style> #post_sx {background:url("../images/posts/T_P1.png") right center no-repeat;} </style>';

Style doesn’t work properly.

Can you help me?

Answer Source

Using double quotes instead of single quotes for the string allows you to use single quote inside it:

echo "string with 'quotes' inside";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download