return a string a addslashes?

Discussion in 'PHP' started by mahmood, May 23, 2006.

  1. #1
    I just noticed that when I use addslashes for a string in a function and return that string no slash will be added to the string like this:
    the above would return "Rose's book" instead of "Rose\'s book", it that right?
     
    mahmood, May 23, 2006 IP
  2. Young Twig

    Young Twig Peon

    Messages:
    27
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    No. Addslashes should add slashes no matter where you call it. :)
     
    Young Twig, May 23, 2006 IP
  3. mahmood

    mahmood Guest

    Messages:
    1,228
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That's right, I guess my problem is somewhere else.
     
    mahmood, May 23, 2006 IP
  4. Bartbos

    Bartbos Peon

    Messages:
    29
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Why would you even need a wrapper function for that?
     
    Bartbos, May 27, 2006 IP
  5. mahmood

    mahmood Guest

    Messages:
    1,228
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Actually it was not the only statement in the function, I thought the problem was with it but it wasn't.

    .
     
    mahmood, May 27, 2006 IP