PHP Remove Zeros At Beginning of String


PHP Remove Zeros At Beginning of String

When you work with numbers, you could end up with zero(s) at the beginning of a string. If you want to remove the zeros at the beginning, you can do it easily with the ltrim() function.

$variable = ltrim(var,'0');