access and modify array through include file and function
<p>Not sure why I can't modify an array by calling a function that includes a file that then references that array.</p>

<p>Here is the situation:</p>

<p>config.php:</p>

<pre><code>$db['default']['password'] = "password";  
$db['default']['database'] = "dbname";

check_if_local_file_exists(__FILE__);
</code></pre>

<hr>

<pre><code>function check_if_local_file_exists( $calling_file )  
{
   $local_version = dirname( $calling_file ) . '/' . basename( $calling_file , '.php' ) . '.local';

   if ( file_exists ( $local_version ) ) {    
     @include_once( $local_version );  
   }  

} // function
</code></pre>

<hr>

<p>config.local:</p>

<pre><code>global $db;

$db['default']['password'] = "password_modififed";  
$db['default']['database'] = "dbname_modified";
</code></pre>

<hr>

<p>Not sure why I can't modify the $db array in the included file: config.local that is included by the check_if_local_file_exists function.</p>

<p>When I print_r ($db ) after calling check_if_local_file_exists(<strong>FILE</strong>) in config.php, the $db array has not been modified at all. . .</p>
