How to import Namespace on PHP?
Namespaces can be imported with the use operator, e.g. myapp2.php:
1 2 3 4 5 6 7 8 9 10 11 |
<br /> &lt;?php<br /> use AppLib2;<br /> require_once('lib1.php');<br /> require_once('lib2.php');<br /> header('Content-type: text/plain');<br /> echo Lib2MYCONST . &quot;n&quot;;<br /> echo Lib2MyFunction() . &quot;n&quot;;<br /> echo Lib2MyClass::WhoAmI() . &quot;n&quot;;<br /> ?&gt;</p> <p> |