Replace "

Discussion in 'PHP' started by cancer10, Jun 8, 2007.

  1. #1
    Hey


    Does anyone knows how do I replace a " (double quote) in a string with nothing

    I tried the following but does not work

    $message = str_replace(""","",$_REQUEST['txtMessage']);
    or
    $message = str_replace("""","",$_REQUEST['txtMessage']);
    or
    $message = str_replace("\"","",$_REQUEST['txtMessage']);
    Code (markup):

    Plz help

    Thanx
     
    cancer10, Jun 8, 2007 IP
  2. decepti0n

    decepti0n Peon

    Messages:
    519
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    $message = str_replace('"', '', $_REQUEST['txtMessage']);
     
    decepti0n, Jun 8, 2007 IP
  3. cancer10

    cancer10 Guest

    Messages:
    364
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    worked thanx :)

    Had to add stripslashes(str_replace('"','',$_REQUEST['txtMessage']));
     
    cancer10, Jun 8, 2007 IP