Dumb question
Moderator: General Moderators
Dumb question
How can I include ""'s inside an echo command? Is there limit to the number of "" that can be used inside an echo command? Thanks.
- andyhoneycutt
- Forum Contributor
- Posts: 468
- Joined: Wed Aug 27, 2008 10:02 am
- Location: Idaho Falls
Re: Dumb question
Escape characters in double-quoted text to print them as literals. For instance:
Gives, literally: Jane said, "Hi! How are you?"
Beware that text in single-quotes is treated as literal and non-interpreted. For example:
Will output as: Jane said, $what_jane_said\n. Rather than the possible desired: Jane said, Hi! how are you?<new line>.
-Andy
Code: Select all
$text = "Jane said, \"Hi! How are you?\"";Beware that text in single-quotes is treated as literal and non-interpreted. For example:
Code: Select all
$text = 'Jane said, $what_jane_said\n';-Andy
Re: Dumb question
Awesome, thanks...!
Re: Dumb question
If I am trying to send html through mail(), how do I get the message to show up correctly without displaying all of the html code? Thanks.
- andyhoneycutt
- Forum Contributor
- Posts: 468
- Joined: Wed Aug 27, 2008 10:02 am
- Location: Idaho Falls
Re: Dumb question
You should probably post this question in a new topic to help keep the forums organized.
Thanks,
Andy.
Thanks,
Andy.
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Dumb question
Can you show an example?
You will need to escape any inner quotes but no there is no limit!
eg. echo "He said \"Jump jump\"";
You will need to escape any inner quotes but no there is no limit!
eg. echo "He said \"Jump jump\"";