Separating a string (by letters and numbers)
Posted: Fri Apr 23, 2010 5:07 am
I've searched high and low on the forum and Google and haven't found an answer so I've resorted to posting on here with an embarrassingly trivial question.
I have a string which will contain an upper case letter, any number of lowercase letters, then any number of tabs/spaces then an integer. I wish to separate this string. First of all I am using trim() to remove the unwanted tabs and spaces. I then wish to take the string (case-sensitive) and store that in one array, then take the integer and store that in a variable for other use...
An example would be:
"Arttsdfsf 678"
To result in:
$theArray = array('Arttsdfsf');
$theVariable = 678;
Any ideas please?
I have a string which will contain an upper case letter, any number of lowercase letters, then any number of tabs/spaces then an integer. I wish to separate this string. First of all I am using trim() to remove the unwanted tabs and spaces. I then wish to take the string (case-sensitive) and store that in one array, then take the integer and store that in a variable for other use...
An example would be:
"Arttsdfsf 678"
To result in:
$theArray = array('Arttsdfsf');
$theVariable = 678;
Any ideas please?