Im guessing you are checking what output the .txt file provides and not the actual contents:
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:
AddType application/x-httpd-php .txt
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.