PHP to text function
<p>I am trying to create a function that would parse php code and return the result in pure text, as if it was being read in a browser. Like this one:</p>

<pre><code>public function PHPToText($data, $php_text) {
    //TODO code
    return $text; 
}
</code></pre>

<p>I would call the function like this, with the params that you see below:</p>

<pre><code>$data = array('email' =&gt; 'test@so.com');
$string = "&lt;?= " . '$data' . "['email']" . "?&gt;";

$text = $this-&gt;PHPToText($data, $string);
</code></pre>

<p>Now <code>echo $text</code> should give: <em>test@so.com</em></p>

<p>Any ideas or a function that can achieve this nicely?</p>

<p>Thanks!</p>
