This is a discussion on RegExp: replace quote marks within the alt.comp.lang.php forums, part of the PHP Programming Forums category; wrote the following test form to replace quote marks with empty string but I get back the original string with ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
wrote the following test form to replace quote marks with empty string but I
get back the original string with the quotes replaced by backslashes. Can anyone say why and suggest a fix? I'm using Internet Explorer and php 4.3.10 Thanks. R <? import_request_variables('p', 'h_'); $pattern = "/\"/"; $replacement = ""; $h_JobDescription=preg_replace($pattern, $replacement, $h_JobDescription); ?> <html> <body> <form name="InfoJob" method="post" action="tst.php"> <input size="20" name="JobDescription" value="<?=$h_JobDescription?>"> <input type="submit" value="Submit New Job"> </form> </body> </html> |
|
|||
|
I noticed that Message-ID: <i6qdnZ_2o588CtvfRVn-rA@comcast.com> from r
contained the following: $h_JobDescription=preg_replace($pattern, $replacement, stripslashes($h_JobDescription)); -- Geoff Berrow (put thecat out to email) It's only Usenet, no one dies. My opinions, not the committee's, mine. Simple RFDs http://www.ckdog.co.uk/rfdmaker/ |
|
|||
|
Thank You!
....don't know how I would have stumbled across that in the PHP docs... R "Geoff Berrow" <blthecat@ckdog.co.uk> wrote in message news:2j7d41tbbk1f7s3ps6n6sf2415j7brctbo@4ax.com... >I noticed that Message-ID: <i6qdnZ_2o588CtvfRVn-rA@comcast.com> from r > contained the following: > > $h_JobDescription=preg_replace($pattern, $replacement, > stripslashes($h_JobDescription)); > > -- > Geoff Berrow (put thecat out to email) > It's only Usenet, no one dies. > My opinions, not the committee's, mine. > Simple RFDs http://www.ckdog.co.uk/rfdmaker/ |
|
|||
|
I noticed that Message-ID: <w6KdncFjLMWgj9rfRVn-1Q@comcast.com> from r
contained the following: >Thank You! >...don't know how I would have stumbled across that in the PHP docs... Read up on 'magic quotes'. -- Geoff Berrow (put thecat out to email) It's only Usenet, no one dies. My opinions, not the committee's, mine. Simple RFDs http://www.ckdog.co.uk/rfdmaker/ |
![]() |
| Thread Tools | |
| Display Modes | |
|
|