View Single Post
  #8 (permalink)  
Old 04-18-2008, 07:45 AM
jegan jegan is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Posts: 161
jegan is on a distinguished road
Default Re: PHP Classes For Beginners

Member Function in BOX

The behavior of an object is defined by the member functions. The behavior or the member functions is normally affects the state or member variables. The box objects can have a member function to initialize the member variables width and height.

For example
PHP Code:
function pmWidth)
{
     
$this->width    =    pmWidth;
}
function 
setHeight(pmHeight)
{
    
$this->height    =    pmHeight;

Class
PHP Code:
class Box
{
    var  
width;
    var 
height;

function  
setWidth(pmWidth)
{
     
$this->width    =    pmWidth;
}
function  
setHeight(pmHeight)
{
    
$this->height    =    pmHeight;
}


__________________
Thanks & Regards,
Jegan CBK
"We will either find a way, or make one!”

Last edited by jegan : 04-21-2008 at 06:39 AM.
Reply With Quote