What is namespaces in PHP?

Member

trycia.jones

by trycia.jones , in category: Technology , a month ago

What is namespaces in PHP?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by kenny , a month ago

PHP Namespaces provide a way of grouping related classes, interfaces, functions and constants.

1
2
3
4
5
6
# define namespace and class in namespace
namespace Modules\Admin\;
class CityController {
}
# include the class using namesapce
use Modules\Admin\CityController ;