关于PHP页处理的问题(初级) 以外层为准执行以后可以查看源代码为<?php echp 'hello,world!'; ?> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?php echo "<?php?> echo 'hello,world!'; ?>"; echo '<br>'; echo htmlspecialchars("<?php echo 'hello,world!'; ?>");?>结果为echo 'hello,world!'; ?><?php echo 'hello,world!'; ?>大家解释一下原因 1. echo "<?php?> echo 'hello,world!'; ?>"; 它将echo 中的<?php?>编译成html中的php脚本。2. echo htmlspecialchars("<?php echo 'hello,world!'; ?>"); 而这句话通过htmlspecialchars将<?php ?>中的东西原样输出了 浏览器显示:echo 'hello,world!'; ?><?php echo 'hello,world!'; ?>浏览器源代码:<?php?> echo 'hello,world!'; ?><br><?php echo 'hello,world!'; ?>不是很正常吗? <?php echo "<?php echo 'hello,world1!'; ?>";?>中的"<?php echo 'hello,world1!'; ?>"被认为是字符串,所以代码显示为:<?php echo 'hello,world1!'; ?>,但这其中又有<?php ?>,html无法解释,所以页面什么也显示不出来。echo "<?php?> echo 'hello,world!'; ?>";的道理也是一样的,<?php?>无法显示,只能显示出echo 'hello,world!'; ?>。而echo htmlspecialchars("<?php echo 'hello,world!'; ?>");一句,由于htmlspecialchars函数把后面的字符串"<?php echo 'hello,world!'; ?>"转化成了能被html显示的特殊格式,所以页面显示的是正常的。 无法使用curl_init函数 构造函数问题 数组排序? 关于php实现图片点击下载的方法 新人求帮助~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PHP验证码出现红X 不知道哪错了 请教高手 当客户端禁用COOKIE时,如何使用SESSION来设置/保存状态信息? 急!在线等...... 哪里有PHP最新的英文版手册 php实现文章点击量,老是失败,求助 在IIS下配置PHP遇到的问题? 请教:如何一次插入多条记录
echo "<?php?> echo 'hello,world!'; ?>";
echo '<br>';
echo htmlspecialchars("<?php echo 'hello,world!'; ?>");
?>结果为echo 'hello,world!'; ?>
<?php echo 'hello,world!'; ?>大家解释一下原因
echo "<?php?> echo 'hello,world!'; ?>";
它将echo 中的<?php?>编译成html中的php脚本。
2.
echo htmlspecialchars("<?php echo 'hello,world!'; ?>");
而这句话通过htmlspecialchars将<?php ?>中的东西原样输出了
echo 'hello,world!'; ?>
<?php echo 'hello,world!'; ?>浏览器源代码:
<?php?> echo 'hello,world!'; ?><br><?php echo 'hello,world!'; ?>不是很正常吗?
echo "<?php echo 'hello,world1!'; ?>";
?>
中的"<?php echo 'hello,world1!'; ?>"被认为是字符串,所以代码显示为:
<?php echo 'hello,world1!'; ?>,但这其中又有<?php ?>,html无法解释,所以页面什么也显示不出来。echo "<?php?> echo 'hello,world!'; ?>";的道理也是一样的,<?php?>无法显示,只能显示出echo 'hello,world!'; ?>。而echo htmlspecialchars("<?php echo 'hello,world!'; ?>");一句,由于htmlspecialchars函数把后面的字符串"<?php echo 'hello,world!'; ?>"转化成了能被html显示的特殊格式,所以页面显示的是正常的。