In PHP, the first few slashes of xxxxxxxxxxxx represent the namespace, and the last one xxxx represents the variables, classes, etc. in the namespace The first slash represents the top-level domain name space, which can be omitted, so it is generally For variables or classes in the top-level domain name space, write directly $xxx or XXXX.
PHP documentation: Global namespace: http://php.net/manual/en/lang... Namespace: http://php.net/manual/en/lang...
The meaning of top-level namespace.
You can take a look at the php documentation. http://php.net/manual/en/lang...
In PHP, the first few slashes of
xxxxxxxxxxxx
represent the namespace, and the last onexxxx
represents the variables, classes, etc. in the namespaceThe first slash represents the top-level domain name space, which can be omitted, so it is generally For variables or classes in the top-level domain name space, write directly
$xxx
orXXXX
.PHP documentation:
Global namespace: http://php.net/manual/en/lang...
Namespace: http://php.net/manual/en/lang...