RE: [PHP] Extracting first eight characters of a string

From: Date: Thu, 07 Nov 2002 15:19:03 +0000
Subject: RE: [PHP] Extracting first eight characters of a string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-123172@lists.php.net to get a copy of this message
how about this: $cutstring = substr(preg_replace("\W","",$originalstring),0,8); -----Original Message----- From: Adam Voigt [mailto:adam@cryptocomm.com] Sent: Thursday, November 07, 2002 8:10 AM To: John Meyer Cc: php-general@lists.php.net Subject: Re: [PHP] Extracting first eight characters of a string Umm, this won't check, only blindly pull the first 8, but: $cutsring = substr($originalstring,0,8); Adam Voigt adam.voigt@cryptocomm.com On Thu, 2002-11-07 at 10:06, John Meyer wrote: > How do I extract only the first eight characters (alpha-numeric) in a string. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#123172) next »