ShashankGaurav Posted April 17, 2014 Share Posted April 17, 2014 I am a php newbie.Can anyone explain me this line of code ? echo "<option value=\"$c\">$c</option>\n"; Why do we use "\" around $c? Link to comment https://forums.phpfreaks.com/topic/287856-syntax-help/ Share on other sites More sharing options...
requinix Posted April 17, 2014 Share Posted April 17, 2014 Because without those backslashes, PHP thinks the first quote is ending the string. Just like the one at the end is actually doing. The backslash tells PHP that you want a literal quote character there. Link to comment https://forums.phpfreaks.com/topic/287856-syntax-help/#findComment-1476545 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.