I've defined on config.php:
define('ROOT', __DIR__);
and on index.php:
require_once (ROOT.'/header.php');
result:
Notice: Use of undefined constant ROOT - assumed 'ROOT'
Why ROOT constant isn't working? I'm learning, someone could explain me?
EDIT
If I put:
require_once (__DIR__.'/header.php');
It works. Someone could explain me why?
It wasn't working cause ROOT was defined inside 'header.php'.
It needs to be defined before call header.php.
Thanks for any help.