note 17579 deleted from function.preg-match by zak
| From: | zak@php.net | Date: | Sat, 15 Dec 2001 03:45:16 +0000 |
| Subject: | note 17579 deleted from function.preg-match by zak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22831@lists.php.net to get a copy of this message | ||
Searching for the contents of a variable took a few minutes to figure out.
$search = "joebob";
ereg($search,$contents); works IF it doesn't time out.
preg_match($search,$contents); doesn't
Put it in a format preg understands with some delimiters:
$search_new = "'" . $search . "'";
preg_match($search_new,$contents);
Then you can put your i s g after the second single quote (ie, ."'is";).