Passing variable to PHP function to be eval'd (DB query)
<p>I'm having trouble describing this issue, which is probably why I can't find the answer on google.. so I figured I would try getting help here. If I'm repeating this question, feel free to direct me to a link to the thread.</p>

<p>So basically the issue I'm having is I am trying to pass a variable to a function that contains some php code to be eval'd.</p>

<p>Here's the simplified version of the code:</p>

<pre><code>function senduser($body) {

    $query = mysql_query("SELECT * FROM User_tbl");
    while ($row = mysql_fetch_array($query)) {

        echo eval($body);

    }

}

$body = 'Hello $row[\'user_first_name\'] &lt;br&gt;';
sendUser($body);

--
</code></pre>

<p>For some reason, the output isn't putting out what I want. I've gotten a few whitespace errors, and a few times I've gotten the code to output the plain text of the variable $body.</p>

<p>Any help is appreciated. Let me know if I need to clarify the issue further.</p>
