PHP variable defined in 'parent' file not recognized in 'required' file
<p>I am trying to access a variable defined in parent file from inside the required file, like this:</p>

<p>&lt;&lt;&lt; parent.php >>><br/></p>

<pre><code>$controller = 'index';
require ('child.php');
</code></pre>

<p>&lt;&lt;&lt; child.php >>><br/></p>

<pre><code>echo $controller;
</code></pre>

<hr>

<p>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.</p>

<p>Regards<br/>
Nikhil Gupta</p>
