Re: REGEX prob
| From: | Christian Reiniger | Date: | Sat, 17 Feb 2001 17:00:13 +0000 |
| Subject: | Re: REGEX prob | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-40361@lists.php.net to get a copy of this message | ||
On Saturday 17 February 2001 21:49, n e t b r a i n wrote:
> function change_sess(&$html_code){
> if(eregi("&flag=[0-9]{9}&PHPSESSID=[[:alnum:]]{32}",$html_code)){
>
>
> str_replace("&flag=[0-9]{9}&PHPSESSID=[[:alnum:]]{32}","<?=append_url()
>;?>", $html_code);
str_replace doesn't know about regular expressions, so it tries to find
the literal string "&flag=[0-9]{9}&PHPSESSID=[[:alnum:]]{32}" in your URL
- which it doesn't find.
Use eregi_replace instead
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
"Software is like sex: the best is for free" -- Linus Torvalds