SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2000
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, everybody

    evertime i try to read from a file and output a string with a ' (apostrophe), PHP automatically adds a \ (slash) in front of it. how to prevent this from happening? it's quite annoying to see "Hi, how\'s life?" in your guestbook...

    - Jeremy
    Hope that helps
    - Jeramii-chan (Jeremy)
    _____________________________
    a@hk : http://www.animehk.com/

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Parse your string through the strip slashes function before echo/printing it.

    stripslashes($myString);

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't forget to assign the value of the function to a var

    $myString = stripslashes($myString);
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •