If I have a variable in PHP containing 0001 and I add 1 to it, the result is 2 instead of 0002.
0001
0002
How do I solve this problem?
$foo = sprintf('%04d', $foo + 1);