PHP Storing Formatted String – String Function

<?php
$dosh = sprintf("%.2f", 2.334454);
print "$dosh dollars";
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.