learning to right objects
| From: | Blake Schroeder | Date: | Wed, 11 Aug 2004 21:35:33 +0000 |
| Subject: | learning to right objects | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-193508@lists.php.net to get a copy of this message | ||
I am trying to change some of my functions in to classes and objects. I have been checking out the php.net and google and still not grasping the concept.
here is my example all I am trying to do is print 2 numbers to the browser that are randomly generated from dieRolls.
Thanks in advance
-Blake
class dieRolls{
function dieRolls($die){
$num = rand(1, $die);
$this->num;
}
}
$num1 = new dieRolls("6"); $num2 = new dieRolls("8"); $bar1 = $num1->bar1; $bar2 = $num2->bar2; echo"Hi<br>\n"; echo"$bar1<br>\n"; echo"$bar2<br>\n"; -- +-----------------+-----------------+----------------+ | Blake Schroeder | Owner/Developer | lhwd.net | +--(http://www.lhwd.net)------------+--/ \--+