What to do if the spl_autoload_register fails to load

Source: Internet
Author: User
Spl_autoload_register What to do if the load fails?
Today's study encountered two questions, first of all, I use wamp,php5.3.9,
When learning the functions of automatically loading classes
1.__autoload ($className) is dead or alive, I echo inside, but no output, then PHP does not automatically call it.

2. When 1 didn't work, I found Spl_autoload_register, and this really worked. But I have a question, how to deal with the more friendly when there is really no required class file? For example Http://localhost/index.php?action=Unknow does not exist for this UnknowAction.class.php, this case is fatal. I want to jump to another error.php page.

Thank you

------Solution--------------------
PHP Code
  
  
------Solution--------------------
Want to jump words with the header function or output a section of JS to jump on the line.
------Solution--------------------
Better not use this Ah, not too flexible.
  • 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.