Tag Archives: php namespaces

How to use PHP namespaces

namespace

PHP namespaces Before we dig in into namespaces, we have to understand what they are, and how they are used. A simple analogy can be made between PHP namespaces and a filesystem. They work quite the same and apply the same principle. Imagine the following directory structure:

Everything clear. You have a “foo.txt” file in the

Request an article ←