The method that calls this class prompts me for call to undefined function. Beginner's Advice

Source: Internet
Author: User
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

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.