Provides various official and user-released code examples. For code reference, you are welcome to learn about the php module's automatic loading of simple versions of autoload. php.
Step 1: Create autoload. php with the following content.
Class autoload
{
Public static function load ($ classname)
{
$ Filename = sprintf ('% s. php', str_replace (' \ ','/', $ classname ));
If (is_file ($ filename) require_once $ filename;
}
}
Spl_autoload_register (['autoload', 'load']);
Step 2: Create the QueryPhone test module as follows.
Namespace app;
Class QueryPhone
{
Public static function find ($ phone)
{
Var_dump ($ phone );
}
}
Step 3: Create and test the api. php file. The content is as follows.
Require_once 'autoload. php ';
App \ QueryPhone: find ('20140901 ');
Step 4: test the browser.
Http://blog.popyelove.com/
Http://blog.popyelove.com /? P = 71
AD: truly free, domain name + VM + enterprise mailbox = 0 RMB