How to deal with spl_autoload_register loading failure? I encountered two problems during my study today. first, I used WAMP and PHP5.3.9. when I learned to automatically load functions of the class. _ autoload ($ className) cannot be used for life or death. I echo it in it, but there is no output, so PHP does not automatically call it. what should I do when spl_autoload_register fails to load?
I encountered two problems during my study today. first, I used WAMP, PHP5.3.9,
When learning to automatically load a class function
1. _ autoload ($ className) is useless. I echo it in it, but no output, so PHP does not automatically call it.
2. when 1 does not work, I find spl_autoload_register, which is actually usable. But I have a question: how can I deal with this kind of file when there is no required class? For example, http: // localhost/index. php? Action = Unknow does not exist in this UnknowAction. class. php, which is fatal. I want to jump to another error. php page.
Thank you.
------ Solution --------------------
PHP code
------ Solution --------------------
If you want to jump, use the header function or output a piece of js to jump.
------ Solution --------------------
It's best not to use this. it's not flexible.