Re: Seperate a variable
| From: | Hugh Bothwell | Date: | Sat, 28 Jul 2001 22:47:18 +0000 |
| Subject: | Re: Seperate a variable | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-10866@lists.php.net to get a copy of this message | ||
"Sharmad Naik" <sharmad@goatelecom.com> wrote in message
news:20010728210644.A830@goatelecom.com...
> Hi,
> I m extracting a variable from a dbase and assigning it as say
> $var .The Value of this variable is always a/or more number/s at the
begining
> followed by a set of characters .I want to seperate the numbers from
> the characters.Can anybody explain me how to
> say value of $var= 511Tha
ereg("([0-9]*)([A-Za-z]*)", $var, $reg);
then $reg[1] = "511" and $reg[2] = "Tha";