pagination javascript php

#pagination javascript php:

$x=$numStories;
$y=$x%5;
$z=($x-$y)/5;
if($y!=0){
    $numPages=$z+1;
}
else{
    $numPages=$z;
}
Xabos