$total is 1232 $number is 238 The out put will show 19%
$percentage = round($number * 100 / $total)."%"; // Get percentage echo $percentage;