Im guessing you are checking what output the .txt file provides and not the actual contents:
IE:
echo("1"); // you want to get the 1 and not the full string?
If you do, there is another way that you could possibly use. You could set the .txt files as executable on your server. You can do this by modifying (or creating) a .htaccess file and adding the following:
For example:
Code:
<Files test.txt>
AddType application/x-httpd-php .txt
</Files>
This will make a file called test.txt executable as php.
However, if you are running user supplied code, IE not code you wrote. I strongly recommend NOT following this approach, or indeed even the eval approach as it is a massive security risk.