Web Analytics Made Easy -
StatCounter Apostrophe in Text Output - CodingForum

Announcement

Collapse
No announcement yet.

Apostrophe in Text Output

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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 :::

  • #2
    You escape the single-quote with a backslash.
    PHP Code:
    $string 'You\'re, it\'s, we\'re...'
    It will print out without the backslashes of course.
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.

    Comment


    • #3
      are yours text stored in db or text file?
      Free php image upload script
      Personal web developing blog

      Comment


      • #4
        or use double quotes:
        PHP Code:
        echo "you're we're they're"
        (if you have any "s in the string, then they'll need escaping though)
        My thoughts on some things: http://codemeetsmusic.com
        And my scrapbook of cool things: http://gjones.tumblr.com

        Comment

        Working...
        X