PHP assign variable definition from a string
<p>Let's say I have a file "<code>English.txt</code>" containing these lines :</p>

<pre><code>$_LANG["accountinfo"] = "Account Information";
$_LANG["accountstats"] = "Account Statistics";
</code></pre>

<p><strong>Note</strong> : the file extension is <code>.txt</code> and there is <strong>nothing</strong> I can do to change that. There is no opening PHP tag (<code>&lt;?php</code>) or anything, <em>just</em> those lines, period.</p>

<p>I need to extract and actually get the <code>$_LANG</code> array declared from these lines. How do I do that? Simply <code>include</code>ing the file echoes every line, so I do </p>

<pre><code>ob_start();
include '/path/to/English.txt';
$str = ob_get_clean();
</code></pre>

<p>Now, if I call <code>eval</code> on that string, I get an <code>syntax error, unexpected $end</code>. Any ideas?</p>

<p>Thanks.</p>
