RE: [PHP-GENERAL] Remove double quotes from string

From: Date: Tue, 16 May 2000 20:06:20 +0000
Subject: RE: [PHP-GENERAL] Remove double quotes from string
Groups: php.general 
Request: Send a blank email to php-general+get-122@lists.php.net to get a copy of this message
Hi, > I havent been able to replicate your problem.. Originally you > wanted to > change double quotes to nothing, in which case > $mytext=str_replace("\"","",$mytext); works OK for me.. I think I have tracked the problem of the additional "\" which should not be there. php3 seems to add to any text field submitted via an HTML form which contain double quotes a "\". Probably to prevent trouble when it gets further processed. Similar to the lite(mSQL) function msqlEncode($string). Thus, you could not see the problem which I had. Strange, any idea how you can trun off this feature? Heiko > > > -----Original Message----- > > From: Spallek, Heiko [mailto:heiko@dental.temple.edu] > > Sent: Tuesday, May 16, 2000 20:31 > > To: 'stephan_schoell@student.ethz.ch' > > Cc: 'php-general@lists.php.net' > > Subject: RE: [PHP-GENERAL] Remove double quotes from string > > > > > > Hi Steff, > > > > > replace the string delimiting quotes (") by single quotes (') > > > and try the following modification of your statements: > > > > > > $quoteText = strtr($quoteText, '"', ' '); > > > $quoteText = str_replace('"', ' ', $quoteText); > > > > > > In general ' and " quotes have exactly the same meaning. But > > > be aware of the problems that could araise. Take notice of > > > the execution precedence of php, javascript/html and so on... > > Thanks a lot! > > > > When I use it, however, both translate the content of a input > > text box from > > an HTML form which contains > > > > "Nothing is ..." > > > > into > > \Nothing is ...\ > > > > which I don't like. I need the string just plain without the '\'. > > > > Any idea? > > > > Heiko > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.general (#122) next »