Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2001072

[PHP-DB] Re: Seperate a variable From: Hugh Bothwell (hugh_bothwell <email protected>)
Date: 07/28/01

"Sharmad Naik" <sharmad <email protected>> wrote in message
news:20010728210644.A830 <email protected>
> 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";

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>