Replace only uncomment string with str_replace in php
<p>log.php</p>

<pre><code>define ( 'COMPANY_WEB', 'www.6666.com' );
//define ( 'COMPANY_WEB', 'www.6666.com' );
define ( 'COMPANY_FAX', 'asdfffff' );
</code></pre>

<p>My string replace code....</p>

<pre><code>$config_old_arr[0] = " define ( 'COMPANY_WEB', 'www.6666.com' )";
$config_new_arr[0] = " define ( 'COMPANY_WEB', 'www.NEW.com' )";

$config_new_file_content = str_replace($config_old_arr, $config_new_arr, $logfilecontent);
</code></pre>

<p>After run my code...
change New log.php file </p>

<p>logNew.php</p>

<pre><code>define ( 'COMPANY_WEB', 'www.NEW.com' );
//define ( 'COMPANY_WEB', 'www.NEW.com' );
define ( 'COMPANY_FAX', 'asdfffff' );
</code></pre>

<p>but i want to change only value in not-comment line(line No.1) so result string want to be as below</p>

<p>logNew.php</p>

<pre><code>define ( 'COMPANY_WEB', 'www.NEW.com' );
//define ( 'COMPANY_WEB', 'www.6666.com' );
define ( 'COMPANY_FAX', 'asdfffff' );
</code></pre>

<p>i like to use str_replace() function but that method may be not suitable for this problem
Anyone know solution for this problem please help to me.</p>
