/** * A simple PHP function that calculates the percentage of a given number. * * @param int $number The number you want a percentage of. * @param int $percent The percentage that you want to calculate. * @return int The final result. */ function getPercentOfNumber($number, $percent){ return ($percent / 100) * $number; } echo getPercentOfNumber(928, 25);