PHP在线调试执行的实现方法(附demo源码)
网络编程 2021-07-05 09:10www.168986.cn编程入门
这篇文章主要介绍了PHP在线调试执行的实现方法,实例分析了PHP实现在线调试运行的原理,步骤与具体实现代码,并附带demo源码供读者下载参考,需要的朋友可以参考下
本文实例讲述了PHP在线执行的实现方法。分享给大家供大家参考,具体如下:
运行效果截图如下:
run.php文件如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://.w3./1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>调试php代码</title> </head> <style> iframe{ min-width:600px;} textarea{ max-height:600px} table{ margin:0 auto;} </style> <body> <table border="0" width="100px"> <tr> <th>PHP 代码调试</th> <th></th> <th></th> </tr> <tr> <form action="./run2.php" target="run_iframe" method="post"> <td valign="" align="center"> <textarea name="php_code" cols="50" rows="43"><?php echo file_get_contents('./run3.php'); ?></textarea> </td> <td valign="middle"><button type="submit" style=" width:60px;">执行</button></td> </form> <td valign=""><iframe id="run_iframe" name="run_iframe" src="./run3.php" height="600px"></iframe></td> </tr> </table> </body> </html>
run2.php文件如下:
<?php $code = stripslashes($_POST['php_code']); if(!strstr($code,'<?php')) $code = '<?php'.PHP_EOL.$code ; file_put_contents('run3.php',$code); header("Location:./run3.php");
完整实例代码点击此处。
更多关于PHP相关内容感兴趣的读者可查看本站专题:《》、《》、《》、《》、《》、《》、《》、《》、《》、《》及《》
希望本文所述对大家PHP程序设计有所帮助。
编程语言
- 机械手焊接机器人编程 机械手焊接设备编程
- vb数据库编程实例,vb做数据库
- tiobe世界编程语言排行榜,全球编程语言排行
- 成都java编程培训 成都it编程培训中心
- 编程基础培训,编程基础知识培训
- flash游戏编程基础教程,flash游戏开发教程
- 不会英语能学编程吗 不会英语可以学程序员吗
- 爱心代码编程C语言 爱心代码编程c语言公式
- c语言编程学习入门 c语言编程快速入门
- 西门子plc编程培训 西门子plc编程培训班
- 哪里可以学编程 台州哪里可以学编程
- 少儿编程哪个好 少儿编程哪个品牌好
- 编程是什么意思,图形编程是什么意思
- c语言编程软件下载,c语言编程软件在哪下载
- java编程软件下载,java编程下载手机版
- ug编程培训学校,ug编程培训教程