This post was last edited by ritsu_ on 2013-08-12 15:32:29
PHP function Classes
I php novice just use PHP for a week.
Invoking the method directly in this class actually appears "call to undefined function" This error is very puzzling ah, beg high finger teaching.
Not much, thank you;
The code is as follows:
Class Wxc{echo hqwidn (' aaa '). "
"Echo hqyj (' BBB ');p rivate function hqwidn ($iname) { switch ($iname) {case " OVK2SJNVAZJS4R3K9XPLFQUEUIII ": $idname =" AAA "; break; Case "Ovk2sju_2karjmabyhtnkxpfxppe": $idname = "BBB"; Case "CCC": $idname = "CCC"; Default: $idname = "none"; break; } return $idname; } Private Function Hqyj ($iname) { switch ($iname) {case "a": $mailadrs = "aaa@qq.com"; Case "B": $mailadrs = "bbb@qq.com"; Case "C": $mailadrs = "ccc@qq.com"; Default: $mailadrs = "none"; break; } return $mailadrs; }}
Reply to discussion (solution)
$this->hqwidn
Direct Write Hqwidn is called out-of-class function
$this->hqwidn
Direct Write Hqwidn is called out-of-class function
Thank you I used to use net recently began to use PHP, the foundation read a lot but have not seen about the creation and function of the class ...
In addition, you do not write this standard
The initialization of classes should be done with constructors
function __construct () {
Print "in BaseClass constructor\n";
}
If it's just a random test, I don't have a deal.
In addition, you do not write this standard
The initialization of classes should be done with constructors
function __construct () {
Print "in BaseClass constructor\n";
}
If it's just a random test, I don't have a deal.
These advanced questions have not been studied, if convenient can give a tutorial link or demo, thank you very much!!!
The above example of the official Website Review Edition manual is