I have an ID number that I am store in a database. Let me use the following demonstration as an example of what is happening.
This is an example ID number that is stored in the database: 02080001-SV-01
I select it from the database as $id so for this example, $id = 02080001-SV-01
################################
$id_prefix = substr($id, 0, 4);
$old_id_num = substr($id, 4, 4);
$new_id_num = ($old_id_num + 1);
$id_suffix = substr($id, 8, 14);
$new_id = ($id_prefix . $new_id_num . $id_suffix);
################################
Now, if i print $new_id, it is supposed to say, 02080002-SV-01, but instead, it shows 02082-SV-01
Can anyone help me with this? I really dont know why substr is dropping the zeros off of my string. Thanks..