我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

为什么我的PHP代码转向评论? [重复]

This question already has an answer here:

  • PHP code is not being executed, instead code shows on the page 25 answers

im tried to write php to my html file, im using wampserver, but when i add php in html it's turns to comment why ? Pls help.

<?php 
echo "hello"

 ?>

turns to comment

<--?php 
echo "hello"

 ?-->
</div>

You don't add PHP code to an HTML file.

If the file has PHP code then the file needs to have a valid PHP extension, such as .php for example. The PHP file can contain HTML code also.

近期文章

  • 重新加载表单中的字段时出现问题[关闭]
  • 如何从PHP中的数组中获取索引?
  • 解析JavaScript变量声明[关闭]
  • PHP Wamp服务器[关闭]
  • 在获取两个表值时,whilelopp不正确
  • 数据库中图像上载所需的Codeigniter代码
  • PHP - 如何从DateTime对象获取日期时间字符串
  • 如何使用wordpress进行注册和签名[关闭]
  • 如何指定一个以十进制数开头的列表?
  • 将页面中输入的文本保存到服务器[关闭]
  • 请给我这个图像包含的解决方案[关闭]
  • 如何编写正则表达式从字符串中删除额外的逗号来制作csv
  • 如何在PHP中使用数据库排名选择最佳商店[关闭]
  • 登录后更改文本
  • 如何解码base64图像
  • 如何将两个不同的组合成一个数组
  • 返回更改表单时如何更新数据库? [关闭]
  • 如何将我的代码从PHP更改为HTML?
  • 如何在MYSQL中使用select查询?
  • 从php方法调用的HTML代码[关闭]

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华