NYCPHP Meetup

NYPHP.org

[nycphp-talk] escaping % and _ in a MySQL query

David Mintz dmintz at davidmintz.org
Mon Nov 1 09:47:54 EST 2004


On Sun, 31 Oct 2004, Adam Maccabee Trachtenberg wrote:

> I prefer str_replace() to preg_replace(), but this is essentially what
> I do. Use the feature which allows you to pass multiple search/replace
> pairs as arrays to reduce this to one call.
>
> Somehow this seems missing from PHP Cookbook. I will add it list of
> things for the 2nd Edition.

The Other Cookbook (MySQL Cookbook) doesn't seem to have anything about
this either, so there's probably still a marketplace of hungry consumers
for this  (-;

---
David Mintz
http://davidmintz.org/

$world =~ s|<bush[^>]*>.+</bush>||is;



More information about the talk mailing list