Jump to content

Archived

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

steve m

*SOLVED* Getting Quotes to come up on the screen

Recommended Posts

Hi there,

Can anyone tell me how when I’m in php, and I want to echo text but there are quotes in the text? For example, "Jill went up the hill". This is in a variable, but when I type the quotes in there they don't show up or the text is displayed funky. What is the code or characters to type to get the quotes to show up in the text?

Share this post


Link to post
Share on other sites
print "\"Jack and Jill went up the hill\"";

You need to escape the "'s you want to print with \

Alternatively you could use

print '"Jack and Jill went up the hill"'; (that's single quotes with double quotes inside)

Share this post


Link to post
Share on other sites

×

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.