Re: how do you use a CLASS ???
| From: | dc | Date: | Fri, 20 Jul 2001 18:08:08 +0000 |
| Subject: | Re: how do you use a CLASS ??? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-58951@lists.php.net to get a copy of this message | ||
Lets say you have a class called Car.
You should see a "constructor in the class the same as the class name:
class Car {
function Car(....possible params...) {
}
function start() {
...
}
function stop() {
}
}
To create a new car object you would do something like this:
$myCar = new Car(...possible params...);
Note that you should pass the parameters that the constructor expects (for
instance the constructor could have a parameter called type).
"Sunny at wde" <sandeep_wde@yahoo.com> wrote in message
news:20010720172551.15726.qmail@web3902.mail.yahoo.com...
> ok, this must be the simplest question alive, but help me please??
>
> i've seen loads of classes all over the net, and i want to use them,
> but not sure where to start!
>
> are class files independent of platform??
> do you have to name your variables same as them?
>
> or do i just call it or something? they dont usually have
> documentation, so i'm a bit stumped :(
>
> /sunny
>
> ____________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
> or your free @yahoo.ie address at http://mail.yahoo.ie