如何在php代码中内嵌javascript代码

itlao6 WordPress 开发&源码 前端评论591字数 311阅读1分2秒阅读模式
php代码中可以内嵌JavaScript/html/css代码,使用以下方式即可:

变量=<<<start start文章源自IT老刘-https://itlao6.com/11104.html

JavaScript/html/css代码文章源自IT老刘-https://itlao6.com/11104.html

start;文章源自IT老刘-https://itlao6.com/11104.html

以下为代码示例:文章源自IT老刘-https://itlao6.com/11104.html

<?php $cyg=<<<start文章源自IT老刘-https://itlao6.com/11104.html

<script type="text/javascript">文章源自IT老刘-https://itlao6.com/11104.html

alert("你好,我是IT老五"); 文章源自IT老刘-https://itlao6.com/11104.html

</script> 文章源自IT老刘-https://itlao6.com/11104.html

start;文章源自IT老刘-https://itlao6.com/11104.html

echo $cyg;文章源自IT老刘-https://itlao6.com/11104.html

注意:=<<<start后的script等代码一定要换行编写。文章源自IT老刘-https://itlao6.com/11104.html

 文章源自IT老刘-https://itlao6.com/11104.html

广告推广:淘宝购物,您还没有使用优惠券吗?快来【哇淘】!淘宝天猫京东拼多多唯品会抖音等平台购物,建议先到哇淘领取优惠券,再返回对应平台下单!【点击进入哇淘】https://wawtao.com文章源自IT老刘-https://itlao6.com/11104.html

文章源自IT老刘-https://itlao6.com/11104.html文章源自IT老刘-https://itlao6.com/11104.html
weinxin
我的微信公众号
微信扫一扫关注公众号,不定时更新
itlao6
  • 本文由 发表于 2023年 5月 26日 17:47:06
  • 转载请务必保留本文链接:https://itlao6.com/11104.html
评论  0  访客  0
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定