Trim and substr help
Posted: Thu Sep 02, 2010 11:27 am
I have an ID field that will start with a letter and may have any number of 0's after the letter.
Example:
E00892911 -> 892911
E012993 -> 12993
E178239 -> 178239
L00002134 -> 2134
I need to trim the first letter, which I know how to do:
Now, I need to remove all the 0's in the beginning of $my_new_id, there's no defined amount of how many occurrences there will be. There could be none, or there could be 8.
Example:
E00892911 -> 892911
E012993 -> 12993
E178239 -> 178239
L00002134 -> 2134
I need to trim the first letter, which I know how to do:
Code: Select all
$my_new_id = trim($my_id, $my_id[0]);