-
-
Save sirkitree/1110782 to your computer and use it in GitHub Desktop.
PHP Learning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<p> Jeff Buckley is playing on the radio, and I like it. </p> | |
<p> It's John's birthday. He's so old! </p> | |
<?php print "Jerad said, \"Awesome!\" in response to my last assignment."; ?> | |
<?php print 'But this one I didn\'t quite get at first.'; ?> | |
<p> Using Github to host these code snippets will work well. </p> | |
</body> | |
</html> | |
Ahh- I see!! I actually had the the top red line right at first but then I changed it cause I thought it was only with single quotes. Sweet. Thanks for clarifying Jerad
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So you can see here, that if you're using doube quotes to print a string, and you want the result of the print statement to actually print out any double quotes as well, you must first escape them with a backslash.
The same goes for the single quote.
But you are correct in that you do not have to escape a double quote if your print statement is using single quotes. Nor vice-versa.