when including a file using php function not work?
<p><strong>MY PHP FUNCTION IS</strong> </p>

<pre><code>function functionName()
{
include($_SERVER['DOCUMENT_ROOT']."/path/file.php");
}
</code></pre>

<p><strong>Content of File.php is</strong> 


<pre><code>$foo = 'bar';
</code></pre>

<p><strong>Calling function (content of file test.php)</strong></p>

<p>functionName();</p>

<p><strong>When call function and variable not work</strong></p>

<pre><code>echo $foo;  &lt;- not works
</code></pre>

<p>But when adding code below its works (content of file test.php)</p>

<pre><code>include($_SERVER['DOCUMENT_ROOT']."/path/file.php");
echo $foo; &lt;- its works
</code></pre>
