[SOLVED] Better way for str_pad
Posted: Sun Jun 27, 2004 3:29 pm
Is there a better way to do the following code snipet?
Answer = NUM0235 (Basically the code just increases the string by one.)
I am a self taught coder and I am always trying to learn more ways of doing more streamlined and/or efficient code.
Thanks for your help in advance
Code: Select all
$id_number = "NUM0234";
$only_number = substr($id_number, 3);
$new_number = str_pad($only_number+1, 7, "NUM0", left);I am a self taught coder and I am always trying to learn more ways of doing more streamlined and/or efficient code.
Thanks for your help in advance