Home > Article > Backend Development > Usage and description of php namespace
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;
namespacea;
classmodel{
}
Add namespace b to the beginning of the model file under the name of directory b;
namespaceb;
classmodel{
}
When referencing the file new /space name/class name (model here)
require("a\model.class.php");
$model = new /a/model;
').addClass('pre-numbering').hide();
$(this).addClass('has-numbering').parent().append($numbering);
for (i = 1; i ').text(i));
};
$numbering.fadeIn(1700);
});
});
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.