Jump to content


Photo

*SOLVED* Getting Quotes to come up on the screen


  • Please log in to reply
2 replies to this topic

#1 steve m

steve m
  • Members
  • PipPipPip
  • Advanced Member
  • 50 posts

Posted 10 March 2006 - 04:31 PM

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?


#2 lessthanthree

lessthanthree
  • Members
  • PipPipPip
  • Advanced Member
  • 85 posts
  • LocationUK

Posted 10 March 2006 - 04:39 PM

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)
call me a safe bet, i'm betting i'm not

#3 steve m

steve m
  • Members
  • PipPipPip
  • Advanced Member
  • 50 posts

Posted 10 March 2006 - 04:53 PM

Cool, thanks a lot!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users