PHP Code:
<?
class someclass{
function function1(){
//do something here
}
function function2(){
$this->function1();
}
}
?>
PHP Code:
$c = new someclass;
$c->function1();
$c->function2();
PHP Code:
<?
function function3()
{
return 'do something';
}
class someclass{
function function1(){
//do something here
}
function function2(){
$something_inside = $this->function1();
$something_outside = function3();
}
}
?>

oreilly OOP e-book for a clear understanding, it's very helpful
Leave a comment: