Trim any zeros at the beginning of a string using PHP
You can use ltrim()
and pass the characters that should be removed as second parameter:
$input = ltrim($input, '0');
// 000123 -> 123
ltrim
only removes the specified characters (default white space) from the beginning (left side) of the string.
ltrim($usernumber, "0");
should do the job, according to the PHP Manual