hello
i m new to php , i want to create a function when any string passed through the form , i want to seperate this string and integar and echo it seperately
I mean if a value is send through a rbs123 or kml23rb
i want that the function seperate (rbs and 123) and also (23 and kmlrb)
i m waiting for the reply , i will be very grateful
thanks
shoaib
seperating a string
Moderator: General Moderators
-
jason.carter
- Forum Commoner
- Posts: 35
- Joined: Sat Jan 10, 2009 10:05 am
Re: seperating a string
Try simple
$numbers = ereg_replace("[^0-9]", "", $string);
$characters = ereg_replace("[^A-Za-z]", "", $string);
done.
$numbers = ereg_replace("[^0-9]", "", $string);
$characters = ereg_replace("[^A-Za-z]", "", $string);
done.