public static function pad($input, $length = 0)
    {
        $input = ltrim($input, '0');

        if ($input == '') {
            $input = '0';
        }

        return str_pad($input, $length, '0', STR_PAD_LEFT);
    }
public static function pad($input, $length = 0)
    {
        $input = ltrim($input, '0');

        if ($input == '') {
            $input = '0';
        }

        return str_pad($input, $length, '0', STR_PAD_LEFT);
    }
public static function pad ( $ input , $ length = 0 ) { $ input = ltrim ( $ input , '0' ) ; if ( $ input == '' ) { $ input = '0' ; } return str_pad ( $ input , $ length , '0' , STR_PAD_LEFT ) ; }
Pad left with zeroes to match given length.

@param string $input
@param int    $length

@return string
Pad left with zeroes to match given length .