index.php
实例
<?php namespace Index; use auto\say; use auto\mycolor\color; function my_autoload($name){ $name = str_replace('\\',DIRECTORY_SEPARATOR,$name); require $name.'.class.php'; } spl_autoload_register(__NAMESPACE__.'\\my_autoload'); $say = new say(); $say->hello(); $color = new color();
运行实例 »
点击 "运行实例" 按钮查看在线实例
class.php