I have a file index.phpin a directory Main;
There is also a directory Helpersinside Mainwith the class Helper.
I tried to introduce a class Helpers\Helperin index.phplike:
<?
namespace Program;
use Helpers\Helper;
class Index {
public function __construct()
{
$class = new Helper();
}
}
But that will not work.
How to use namespace and use in PHP?
source
share