Olaf Lederer - 2005-08-01 11:47:30 -
In reply to message 2 from Amr Sobhy
Hello,
The fact you are a starter is not important, I know a lot of people with a age of 16 which are writing very smart php scripts (check www.phphulp.nl).
The point isn't your contribution at all, your script is not an example for using a class. You have more code and files for a simple and small function. On of the most important advantages while using a class is the easy interaction between methods.
If you call somthing simple then write it simple, like:
function pick_random($the_file) {
$read = file($the_file);
$x = shuffle($read);
return $read[$x];
}
echo pick_random("your_file.txt");
PS. Don't stop your contributions, but please write classes first!