Page 1 of 1

"Fortune" to php

Posted: Thu Feb 19, 2004 7:47 pm
by redhair

Code: Select all

<?php

exec ("/usr/games/fortune", $fortuneArray); 
reset($fortuneArray);
while (list ($key, $val) = each ($fortuneArray))
    {
       $fortune .= "<br>\n" . trim($val);
    }
echo $fortune;

?>
:D

I was so happy to get this to work....I had to share it.