我徘徊为什么下面的代码给出了一个错误:致命错误,与命名空间在PHP
<?php
namespace Notebook\Routers{
function exploder($request_uri){
$explode = explode("/", $request_uri);
return ["count"=> count($explode), "values"=>$explode];
}
}
namespace{
use Notebook\Routers;
exploder($_SERVER["REQUEST_URI"]);
}
它说Fatal error: Call to undefined function exploder() in /var/www/index.php on line 13
除非有我丢失的东西。 use Notebook\Routers
应该能够在当前命名空间中导入该函数。
那么,呃,那么使用use关键字的意义呢?我很困惑。 – iOi