Apostrophe in Text Output

This is a discussion on "Apostrophe in Text Output" within the PHP Forum section. This forum, and the thread "Apostrophe in Text Output are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 4th, 2006, 05:34
New Member
Join Date: Jun 2006
Location: Chicago
Age: 33
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Apostrophe in Text Output

Hello.

How do I place an apostrophe in the textual output of a php document?

namely, I want the output to be ::: you're ::: instead of ::: you are :::
Reply With Quote

  #2 (permalink)  
Old Oct 4th, 2006, 06:25
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Apostrophe in Text Output

You've probably tried print ('You're'); and had it complain. Try print ("You're"); instead.

Background - PHP supports single quoted strings (where everything is taken literally) and double quoted strings (where the $ and \ characters have special significance). Although you can use a " in a " string (with \"), you cannot do the same thing to get a ' in a ' string.
Reply With Quote
  #3 (permalink)  
Old Oct 4th, 2006, 12:48
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Apostrophe in Text Output

You can escape apostrophies in a string using apostrophies...

You may also want to look into the functions addslashes() and stripslashes().
Reply With Quote
Reply

Tags
text output

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Php output in to CSS dhossai Web Page Design 1 Oct 30th, 2007 18:38
How to include font name that has apostrophe Lchad PHP Forum 3 Sep 17th, 2007 16:30
apostrophe becomes ’ aaronh Web Page Design 12 Jul 30th, 2007 13:38
using apostrophe in sql statement djanim8 Classic ASP 1 Oct 10th, 2006 13:09
Apostrophe... Lizard- Classic ASP 2 Aug 13th, 2004 13:11


All times are GMT. The time now is 08:29.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43