generates integers with leading 0
An integer will never have 0.
If you need to cast 0, you will need to convert the integer to a string -> see answer from thephpdeveloper. This is the correct way to write a number with a leading 0 in the database - for example.
If you like to work with this integer (for example, for calculations), it is better to leave the integer as an integer (do not change to a string) and every time you need to print these numbers โ make a decision from "Stefan Gerig"
source share