If php is saved, what is the class name and method name? Classa {functionb {What if a_ B is printed here ?}} ------ Solution -------------------- classa {functionb {& nbsp; echo _ CLASS __. & quot; _ & quot ;. _ METHOD __;}------ solution ------------ If you want php to obtain the class name and METHOD name?
Class {
Function B {
// What if a_ B is printed here?
}
}
------ Solution --------------------
Class {
Function B {
Echo _ CLASS _. "_". _ METHOD __;
}
}
------ Solution --------------------
Try this.
PHP code
Class a {function B ($ functionName) {echo get_class ($ this ). '_'. $ functionName ;}} class c extends a {function d () {$ this-> B (_ FUNCTION _) ;}}$ c = new c (); $ c-> d ();
------ Solution --------------------
No parameters are required.
Class {
Var $ v = '';
Function B (){
Echo"
". Get_class ($ this). '_'. $ this-> v;
}
}
Class c extends
{
Function d (){
$ This-> v = _ FUNCTION __;
$ This-> B ();
}
}
$ C = new c ();
$ C-> d ();
------ Solution --------------------
Well, I learned something again, 3Q