How do the methods in the PHP class access other methods in the same way?
Class Action {
function A () {
Function B () {
}
}
Function C () {
How does this call the B method in the A method???
}
}
------Solution--------------------
Do not write like this, what bothered problem, must be so toss it? Say it, and we'll help you figure out a way. Don't try to chase this niu Jiao Jian
------Solution--------------------
It's no big deal.
PHP code
class Action {function A () {function B () {Echo 123; }} function C () {//This is how to call the B method in the A method??? b (); }} $p = new Action; $p->a (); $p->c ();//123b ()//123
------Solution--------------------
Hey, you can make mistakes sometimes.
You want the C function to use the B function, so you have to initialize a () before you use it.
Because a () inside PHP is gray to PHP does not know that a () has a B ()
So you do not initialize a () with B () will definitely go wrong. The
correct call is first A () in C ().
------Solution--------------------
PHP is a major feature, but also a tragedy is that the function definition has no scope, where all the line, as long as it appears.
------Solution--------------------
PHP code
class actio n {function A () {$this->b (); }//Pull out the B () function. function B () {} function C () {//) How do I call the B method in the A method??? $this->b (); }}