How to Create a program to print Factorial of any number?

<?php
$factorial_number = 5;
$fact = 1;
for($f=1;$k<=$factorial_number ;++$f) 
{
$fact = $fact*$f;
}
echo "Factorial of $factorial_number is ".$fact;
?>