I want to have a normal type of class structure like
com.acme.module.Class.php
So how can import packages like this
In other languages I could do something like
import "com.acme.module.Class"
or
import "com.acme.module.*"
Is this possible in with PHP
In PHP 5.3 and higher, we have Namespaces.
According to PSR-0 standard, package names are in the form of directory names. i.e. if I have a class
Mauris\Acme\Controllers\Home(package name isMauris\Acme\Controllersand class name isHome), my class file would be namedHome.phpand placed in the foldersrc/Mauris/Acme/Controllers.Then with an autoloader (there’s a simplified PSR-0 compliant autoloader), you can directly “import” the classes into your script:
Read more at http://php.net/manual/en/language.namespaces.importing.php