Executing functions within ereg_replace() output

From: Date: Sat, 06 Apr 2002 13:12:54 +0000
Subject: Executing functions within ereg_replace() output
Groups: php.general 
Request: Send a blank email to php-general+get-91859@lists.php.net to get a copy of this message
I'm really curious as to how to output data from ereg_replace() in a standard way. I'm familiar with "\\1" to ouput the original string, but not sure as to how I can use functions within the output parameter to process this value further. --------------------- // here is a simple example of what i'm trying to do $content = 'string string 12463409834234 string string'; $content = ereg_replace( "[0-9]{14}" , substr("\\1",0,5) , $content ); // this is the output i want, but the above doesnt seem to be the right way to generate it. string string 12363 string string -------------------- any ideas? -Adam

« previous php.general (#91859) next »