title: Alternative to PHP's eval function
body: <p>I wonder if there's some alternative to the &quot;evil&quot; eval function for my case.</p>
  <p>I have a &quot;settings&quot; form where I generate all my table's header text with PHP/MySql-code, something like:</p>
  <pre><code>$my_user_id = &quot;somedata&quot;;
  SELECT myheader FROM somewhere WHERE user = $my_user_id;
  echo $my_query_result;
  </code></pre>
  <p>So this code is saved in the database.</p>
  <p>And then I have a list template file where I get the code previously written to database like:</p>
  <pre><code>SELECT list_header_text FROM settings WHERE mylist = currentlist
  $myheader_text = $my_query_result;
  </code></pre>
  <p>And then I display the text like:</p>
  <pre><code>echo eval($myheader_text);
  </code></pre>
  <p>I'm not sure if this is a good way to do it. And I have also a problem that I cannot get the stringlength for the code in database. When strlen is 0 I should echo a different header structure in my table header, but strlen returns the length of the code not the echoed value.</p>