PHP 3 -cyfrowy dziesiętny
return number_format((float)$number, 2, '.', '');
Nice Nightingale
return number_format((float)$number, 2, '.', '');
$str = 'In My Cart : 11 items';
$int = (int) filter_var($str, FILTER_SANITIZE_NUMBER_INT);
echo str_pad( "1", 4, "0", STR_PAD_LEFT );
echo str_pad( "12", 4, "0", STR_PAD_LEFT );