My suggestion : $amount = 4.95; //or whatever you want $dollars = floor($amount); $cents = 100*($amount - $dollars); echo "\$$amount or $dollars dollars and $cents cents"; PHP: outputs $4.95 or 4 dollars and 95 cents
$amount = 4.95; //or whatever you want list($dollars,$cents) = explode('.',$amount); echo "\$$amount or $dollars dollars and $cents cents"; PHP: Peace,
$amount = 4.95; //or whatever you want $dollars = substr($amount,0,strpos($amount,'.')); $cents = substr($amount,strpos($amount,'.')+1); echo "\$$amount or $dollars dollars and $cents cents"; PHP: