Thanks! That preg_replace_callback helps alot. -Adam
"Cc Zona" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Adam Wan) wrote: > > > $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? > > For future reference: > <http://www.php.net/preg-replace-callback> > > For this instance: > $content = ereg_replace( "([0-9]{5})[0-9]{9}" , "\\1", $content); > > -- > CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php