Is there any way to restrict a function so that it can only be called from the class that it is declared in? This might not be very well explained so I will give an example...
So you can do...
$example = new example;
$example->a();
$example->b();
and both would work fine. But if I wanted function a to only be called from within function b - would that be possible?
-Geeeeeeeeeeeeeeeeeeeeeeee-
Code:
class example {
function a () {
echo 'a!';
}
function b () {
echo 'b!';
$this->a();
}
}
So you can do...
$example = new example;
$example->a();
$example->b();
and both would work fine. But if I wanted function a to only be called from within function b - would that be possible?
-Geeeeeeeeeeeeeeeeeeeeeeee-