01-30-2008, 06:40 PM
|
#6 (permalink)
|
|
The Addict
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
|
Quote:
Originally Posted by Alan @ CIT
Yep, anything you can do in normal functions you can do in class functions/methods.
Alan
|
its all starting to come together now
so then this code would work?
Code:
Class Human
{
$fname;
$lname;
$mname;
$age;
function checkage($in_age)
{
$this->age = $in_age;
if($this->age < 18) { echo "you are young"; }
if($this->age > 18) { you are old; }
}
function getname($in_fname,$in_lname,$in_mname)
{
$this->fname = $in_fname;
$this->lname = $in_lname;
$this->mname = $in_mname;
echo "hello ".{$this->fname}." ".{$this->lname}." ".$this->mname;
}
}
sorry i dont have a compiler to check
__________________
no signature set
|
|
|
|