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? Quote Link to comment Share on other sites More sharing options...
Solution requinix Posted April 17, 2014 Solution 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.