SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Almeaty Member
    Join Date
    Jul 2000
    Location
    Nowhere
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Words like "isn't" "don't" have those single quotation marks. And what I'm doing here is inserting a text into a variable and insert the contents of the var into a DB. Problem is that this doesn't work. Is there a function to "clean up" the text (inserting a backslash before the quot)?

    thx for help

  2. #2
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $string = "Isn't PHP cool?";
    $string = addslashes($string);
    echo($string); // Prints out "Isn\'t PHP cool?"

    There ya go. Use stripslashes() to remove them when you extract the data from the database.

  3. #3
    Almeaty Member
    Join Date
    Jul 2000
    Location
    Nowhere
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wow, super-duper thx alot!


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
  •