|
Posted by Gregor Kofler on 08/26/07 14:58
Séverin Richard meinte:
> for single quote(') the right syntax may be:
> ereg_replace( "'","\'",$someblog[0] )
> or ereg_replace( "'","\\'",$someblog[0] )
> or ereg_replace( "'","\\\'",$someblog[0] )
>
> try all of this.
Now, that's what I call helpful... Anyway, since he's doing a lot of
trying anyway, he should either stick to preg_replace() if RegEx are
required, since *this* is proper contemporary PHP. However, in this case
RegEx is complete overkill. An ordinary str_replace() will do [1].
Gregor
[1] http://at2.php.net/str_replace
--
http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
http://www.licht-blick.at ::: Forum für Multivisionsvorträge
http://www.image2d.com ::: Bildagentur für den alpinen Raum
[Back to original message]
|