What does PHP mean? $ Ctrl-& gt; $ action (); $ ctrl-> $ action ();
$ Ctrl is an object. what is access to this object?
--------------------------------------------------------------
The access attribute is $ ctrl-> action;
The usage class is like $ ctrl-> action ();
Reply to discussion (solution)
$ Ctrl-> $ action (); is also the name of a method called, but the name of this method is replaced by a variable $ action.
$ Ctrl-> $ action (); is also the name of a method called, but the name of this method is replaced by a variable $ action.
What does this mean? Could you give me a simple example ??
Function fn (){
Echo 1;
}
$ Fn = 'FN ';
$ Fn ();
It is nothing more than putting the function or object method name variables in and running.
However, we recommend that you use function_exist and method_exist to check
Function fn (){
Echo 1;
}
$ Fn = 'FN ';
$ Fn ();
It is nothing more than putting the function or object method name variables in and running.
However, we recommend that you use function_exist and method_exist to check
Thank you. you can understand it in this way ...~
$ Ctrl-> {$ action} (); actually, the value of the $ action variable is treated as a method of the $ ctrl class.