实例
jz.php
<?php //namespace one; spl_autoload_register('myAutoLoad', true, true); function myAutoLoad($className){ include "{$className}.php"; } $space = new space(); echo $space->get();
运行实例 »
点击 "运行实例" 按钮查看在线实例
space.php
实例
<?php //namespace one\two; class space { function get() { echo space::class.'加载成功了'; } } //$space=new space; //echo $space->get();
运行实例 »
点击 "运行实例" 按钮查看在线实例