ereg_replace()

From: Date: Thu, 07 Sep 2000 01:39:30 +0000
Subject: ereg_replace()
Groups: php.general 
Request: Send a blank email to php-general+get-15627@lists.php.net to get a copy of this message
Hi. I am having a problem using a function as the second argument to ereg_replace(). This is an excerpt from my code. Within the filer() function, the paramaters act differently in different functions. BEGIN EXCERPT $matchRegex = "\[(.) (.)+ \]"; while ( eregi( $matchRegex, $templateLine ) ) { $templateLine = eregi_replace( $matchRegex, filter( "\\2", "\\1" ), $templateLine ); } function filter ( $phrase, $flags ) { END EXCERPT 'echo $flags;' outputs "\1", where 'return $flags;' returns "L" (it is supposed to return "L"). Is this a bug in php? Am I misunderstanding the use of \\n? --Drew Vogel

« previous php.general (#15627) next »