Home > Backend Development > PHP Tutorial > PHP命名空间 能用 ../abc 这种路径吗?

PHP命名空间 能用 ../abc 这种路径吗?

WBOY
Release: 2016-06-06 20:06:51
Original
1045 people have browsed it

就是引用父空间的 方法,函数:
我试了试不行,也不知道真不行,还是自己写错了..

<code><?php namesapce a\b;
//★★这里怎么引用下面那个 say?



<?php
namesapce a;
function say()
{
}</code></code>
Copy after login
Copy after login

回复内容:

就是引用父空间的 方法,函数:
我试了试不行,也不知道真不行,还是自己写错了..

<code><?php namesapce a\b;
//★★这里怎么引用下面那个 say?



<?php
namesapce a;
function say()
{
}</code></code>
Copy after login
Copy after login

<code><?php namesapce a\b;

use a\say;

say();</code></code>
Copy after login
Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template