-2

I read that any variable declared after a namespace is then part of that namespace. I was confused then when reading about "URL variables":

<?php 
namespace OddTeaFlavors
return "
<nav>
<a href='index.php?flavor=acidRain'> Try Our new Acid Rain Flavor! </a>
</nav>
";

Would the URL variable flavor be part of the OddTeaFlavors namespace?

4

1 回答 1

2

该命名空间中没有变量,正在返回一个字符串(即数据)。一旦数据出来,您就不再位于该名称空间内。一旦您的 HTML 响应被发送,您甚至不再在服务器上。

于 2015-04-16T18:55:16.380 回答