<?php
$sayi=5;
$fak=1;
for ($i=1; $i<=$sayi; $i++)
{
    $fak=$fak*$i;
    echo $i.”! = “.$i;
    if ($i>1)
    {
      for ($k=$i; $k>=2; $k–)
      {
        echo ” x “.($k-1);
        if (($k-1)==1)
        {
           echo “<br>”;
        }
      }
    }
        elseif($i==1) 
       {
           echo “<br>”;
       }
}
    echo “<b>”.”<br>”.$sayi.”‘in faktöriyeli = “.$fak.” dir.”.”<b>”;

?>