PHP Training in Chandigarh
What are namespaces in PHP?
In the extensive definition namespaces are a way of enclose items. This can be seen as an abstract access in many places. For example, in any operating system agenda serve to group similar files, and act as a namespace for the case within them.
Why Do We Need Namespaces in PHP? As the size of your PHP code study increases, the more likely you will unwitting discuss a function or class name that has been announced before. The problem is distributed if you attempt to add third-party ingredient or plugins; what if two or more code sets device a ‘Database’ class. The only solution has been long class/function names.
How are Namespaces Defined?
By default, all consistent, class and function names are arranged in a global space — like they were before namespaces were backed. Namespaced code is decide using a single namespace keyword at the top of your PHP file.
Sub-namespaces PHP allows you to define a ranking of namespace names so libraries can be subdivided. Sub-namespaces are detached using a backslash (\) character, e.g. ● ● ●
MyProject\SubName MyProject\Database\MySQL CompanyName\MyProject\Co mmon\Widget
CBitss Technologies â—? 09988741983,01725031983 â—? counselor.cbitss@gmail.c om Website : http://cbitss.in/php-training-in-chandigarh/
CBitss Technologies