This:
$difference = 05-1;
results in
4
same if I do this:
$difference = 05-01;
is there a inbuilt way to subtract while keeping leading zeros? I know I can check to see if the difference has only 1 character or not and if so add a leading zero but was just wondering if there is a default way to get the result back with 0 already in it.
No I dont think PHP will natively keep the leading 0’s unless its a float. In PHPs mind
4is4not04tho0.4is0.4So if you need the leading
0in ints lower the10pad it with str_pad():