Jump to content

Escape characters in echo statement


Awanka

Recommended Posts

Why doesn't the following line workin in php?

 

Because it is invalid.

 

You don't need to escape ( ps the escape char is \ not / ) single quotes within double quotes, however you should wrap complex variables (arrays) within curly braces.

 

echo "{$_REQUEST['checkAllDefault']}";

 

In your example though, there is no need for the double quotes at all.

 

echo $_REQUEST['checkAllDefault'];

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.