|
Posted by Mike P2 on 05/10/07 23:54
On May 10, 7:06 pm, Ming <minghu...@gmail.com> wrote:
> Thanks Mike. I still do not quite understand. I do not have any class
> that has getStateName method. It is an object in the remote machine
> that has this method, isn't it? Correct me if I am wrong, it sounds it
> is sufficient to just send $method = 'getStateName'
>
> Ming
Yes, the object is on the remote machine, and the method
'getStateName' is within that object. Just like you might organize
methods into classes in your own php code, the remote machine has
getStateName() organized into an 'examples' object.
In PHP, if you have an object instance in the variable $examples and
the class that it is an instance of has the method getStateName(), you
can't just do:
$whatever = getStateName();
You have to do
$whatever = $examples->getStateName();
Because getStateName() is not in the global scope, it is in the
$examples object.
If you still don't understand and would like to know why you have to
put in 'examples', maybe you should study PHP OOP more to get a better
understanding of OOP.
-Mike PII
Navigation:
[Reply to this message]
|