Mega Code Archive

 
Categories / Php / Strings
 

Sprintf print values to a string

<?php $cost = sprintf("$%01.2f", 43.2);  echo $cost; ?>