PHP Classes

why you call this simple?

Recommend this page to a friend!

      Very simple random text  >  All threads  >  why you call this simple?  >  (Un) Subscribe thread alerts  
Subject:why you call this simple?
Summary:what is this?
Messages:3
Author:Olaf Lederer
Date:2005-08-01 08:27:13
Update:2005-08-01 11:47:30
 

  1. why you call this simple?   Reply   Report abuse  
Picture of Olaf Lederer Olaf Lederer - 2005-08-01 08:27:13
Hello,

I don't understand why it's usefull to put this script inside a class.

It's enough to put this few rows of code inside the script (or maybe inside a function).

Before you contribute next time, first look arround and notice the real php classes here!

  2. Re: why you call this simple?   Reply   Report abuse  
Picture of Amr Sobhy Amr Sobhy - 2005-08-01 10:26:10 - In reply to message 1 from Olaf Lederer
Hello Mr Olaf Lederer,

Thank you for your Critic, but please in case you didn't notice .. Just give a break ! for the junior developpers and learners ..and thanx for you depression ..

THIS site is to enrich the real PHP world ! as u call it .... so a nice critic ending with "well done , try harder next time for something better " would be better ! for sure you weren't born an OOP programmer .. it takes time !

And for asking why i call this "Very simple ? that's because i know it is a very small contribution in the real PHP world !

and Finally thank you again and i promise i won't contribute again ..thanx to you for sure !

Regards ,
Amr

  3. Re: why you call this simple?   Reply   Report abuse  
Picture of Olaf Lederer 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!