Namespace is to solve the problem of duplicate names.
For example, there are model files in both directories a and b;
Add namespace a to the beginning of the model file under the name of directory a;
<code><span>namespace</span><span>a</span>; <span><span>class</span><span>model</span>{</span> }</code>
Add namespace b to the beginning of the model file under the name of directory b;
<code><span>namespace</span><span>b</span>; <span><span>class</span><span>model</span>{</span> }</code>
When referencing the file new /space name/class name (model here)
<code><span>require</span>(<span>"a\model.class.php"</span>); <span>$model</span> = <span>new</span> /a/model;</code>
The above introduces the usage and description of PHP's namespace (namespace), including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.