- round: documentation ( source)
- number_format: documentation ( source)
<?php
$n_sal = 50000;
$n_hrs = 32;
$n_wks = 52;
$rate = number_format(round( ($n_sal / ($n_hrs * $n_wks)) * 100) / 100,2);
$week = number_format(round( ($rate * $n_hrs) * 100) / 100,2);
echo floatval('$50,000.50');
echo PHP_EOL;
echo $rate;
echo PHP_EOL;
echo $week;