Learning PHP and MySQL

Example 11-10 Using sprintf with a variable

<?php
$total
=sprintf("Please  pay  $%.2f.  ",  42.4242);
echo  
$total;
?>

Figure 11-10 displays the result of this code.

Posted by on 08/18 at 04:04 PM

Next entry: Example 11-11 Calculating the length of a string

Previous entry: Example 11-09 Displaying a real number in money format

<< Back to main