'Ana' dosyasında tanımlanan PHP değişken 'gereklidir' dosyasında tanınmadı

0 Cevap

Ben bu gibi gerekli dosya içinde ana dosyasında tanımlanan bir değişkene erişmeye çalışıyorum:

<<< parent.php >>>

$controller = 'index';
require ('child.php');

<<< child.php >>>

echo $controller;

somehow, I am receiving a null output, which means that the variable is not accessible via child.php.. am I doing something wrong here? if possible, please let me know how I can call the above variable in my child.php file, if above seems to be wrong.

Regards
Nikhil Gupta

0 Cevap