Miscellany
public text v1 · immutable<?php
function format_name($name){
return ucWords(strtolower($name));
}
function format_currency($value){
return sprintf("%0.2f",$value);
}
function figure_tax($value){
return $value + ($value * 10 / 100);
}
$name = format_name('joE Roe');
$amount = "10";
$amount_with_tax = figure_tax($amount);
?>
<h1>Order Details</h1>
<ul>
<li><?php echo($name); ?></li>
<li>$<?php echo(format_currency($amount)); ?></li>
<li><?php echo(format_currency($amount_with_tax)); ?></li>
</ul>