sprintf: Regards the string an integer and formats it as a binary number : sprintf « Development « PHP






sprintf: Regards the string an integer and formats it as a binary number


<?

$total = 10.94;

$fmt_total = sprintf ("%b", $total);

echo "$fmt_total";
?>
           
       








Related examples in the same category

1.Type Specifiers for printf() and sprintf()
2.sprintf %0.2f
3.sprintf: Considers the string an integer and formats it with that ASCII value
4.sprintf: Considers the string an integer and formats it as a decimal number