Re: REGEX prob

From: Date: Sun, 18 Feb 2001 16:34:06 +0000
Subject: Re: REGEX prob
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-40438@lists.php.net to get a copy of this message
On Sunday 18 February 2001 19:54, 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_ur > >>l() ;?>", $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 > > Hmmmm, ok but with the eregi_replace the prob is the same ... :( no > changes are made on my cache file ... Ah, yes. str_replace and eregi_replace don't modify the string - they return a modified string. That means you have to do a $html_code = eregi_replace (..., $html_code); -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) AAAAA - American Association Against Acronym Abuse

« previous php.general (#40438) next »