怎么让PHP执行一些自己输入的脚本

有的系统里,用户可以输入自己的PHP的脚本,然后在这个页面中就会执行刚刚输入的PHP脚本,是怎么做到的?

方法一:把自己刚输入的脚本,以xxx.php的形式存下来,然后在这个页面require_once这个xxx.php,我觉得这不是最终的方法
方法二:我不知道,我觉得肯定有方法二
---------------------------------------------------------------

eval()可以
---------------------------------------------------------------

1   
2$text = "echo 'aaaa'";   
3eval("$text;");   

1   
2$text = "
3<?php echo 'aaaa';
4```";   
5eval("?>
6$text");   
7?&gt;
Published At
Categories with Web编程
Tagged with
comments powered by Disqus