Replace "//"-prefixed text with blank space if not inside quotes
<p>match a <code>//</code> in a line of array and replace <code>//</code> with blank space if its not inside <code>" "</code>.
For example I have this line:</p>

<pre><code>//this is a test
"this is a // test"
</code></pre>

<p>the output should be:</p>

<pre>

"this is a // test"
</pre>

<p>it will ignore <code>//</code> inside <code>""</code></p>

<p>for now I've come up with this regex:</p>

<pre><code>$string[$i] = preg_replace('#(?&lt;!")//.*(?!")#',' ',$string[$i]);
</code></pre>

<p>but this does't work if the <code>//</code> is in the middle or last part of a line.</p>
