Hi guys,I was trying to figure out the advantages of OOP in php,but still not getting a good reason to make it use in real work.
Wat I'm trying to say is,
Can someone demonstrate a superb example where,use of classes will really make sense:?
Wat I'm trying to say is,
PHP Code:
class introduceYourself
{
private $_name;
public function __construct($name)
{
$this->_name = $name;
}
public function writeName()
{
echo 'My name is ', $this->_name, .'<br />';
}
}
$intro = new introduceYourself("someone");
$intro->writeName();
///////////////////////////////////
output://////////////////////////
My name is someone///////////
/////////////////////////////////
Comment