Awanka Posted July 10, 2007 Share Posted July 10, 2007 Why doesn't the following line workin in php? echo "$_REQUEST[/'checkAllDefault/']"; I get the error message: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in Link to comment https://forums.phpfreaks.com/topic/59332-escape-characters-in-echo-statement/ Share on other sites More sharing options...
trq Posted July 10, 2007 Share Posted July 10, 2007 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']; Link to comment https://forums.phpfreaks.com/topic/59332-escape-characters-in-echo-statement/#findComment-294743 Share on other sites More sharing options...
Caesar Posted July 10, 2007 Share Posted July 10, 2007 Who do you want to escape those? <?php echo $_REQUEST['checkAllDefault']; ?> Link to comment https://forums.phpfreaks.com/topic/59332-escape-characters-in-echo-statement/#findComment-294744 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.