PHP script for Fibonacci number

PHP script for first 20 Fibonacci numbers
<?php
$count = 0 ;
$c1 = 0;
$c2 = 1;
echo $c1.” , “;
echo $c2.” , “;
while ($count < 20 )
{
$c3 = $c2 + $c1 ;
echo $c3.” , “;
$c1 = $c2 ;
$c2 = $c3 ;
$count = $count + 1;
}
?>

<?php
/* Find number odd or even */
$num = 32;
$even = ($num % 2 == 0);
$odd = ($num % 2 != 0);
?>

Advertisements