
html中可以写php代码,但是文件后缀名需要是.php而不是.html。否则php程序不会被解析执行。
1、新建一个index.php文件,像书写html一样,写上基本标签。
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p>这是html</p><p><span>立即学习</span>“<a href="https://pan.quark.cn/s/7fc7563c4182" style="text-decoration: underline !important; color: blue; font-weight: bolder;" rel="nofollow" target="_blank">PHP免费学习笔记(深入)</a>”;</p>
</body>
</html>2、然后在html代码中插入php代码片段,例如:
商品查询功能提供了一个快速查看商品的途径。商品查询分为基本查询和高级查询。基本查询:提供关键字和商品大类两种条件的查询,用户可以只填写关键字或者选择商品大类或者关键字和商品大类都填写来查询商品。高级查询:提供关键字,商品大类,商品小类,商品价格范围四种条件的查询,用户可以任意填写其中一种或几种的查询条件来查询想要了解的商品信息。商品查询功能大大的方便了用户,提高了网站的用户体验。(5)帮助系统模块
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<p>这是html</p><p><span>立即学习</span>“<a href="https://pan.quark.cn/s/7fc7563c4182" style="text-decoration: underline !important; color: blue; font-weight: bolder;" rel="nofollow" target="_blank">PHP免费学习笔记(深入)</a>”;</p>
<?php echo "hello"; ?>
</body>
</html>3、打开网页即可看见效果:

更多PHP相关知识,请访问PHP中文网!










