Hi, I want to extract string in two parts : alpha and numerical. Here's what my string looks like $test="y03|b227|r1|x2";
I could i seperate the y and 03 from the y03 first part of my string ?
Help appreciate. Thanks.
is the 1st character gonna be a alpha numeric character and 2nd 3rd numerical characters???
If yes then u can get the values as
$Alphanumeric = $test[0]; $Numeric = $test[1].$test[2];
Hope this helps 🙂
Thanks for your help !
The first part a the string will always be a single alphabetical character, second par will be an integer (from 0 to 99999....)
preg_match_all will do exactly what you want. Look at the phone number example at the bottom:
http://www.phpbuilder.com/manual/function.preg-match-all.php
I've found the solution using preg_match()
Thanks for your help.