</script> 的区别-6ren"> </script> 的区别-我只是浏览了那里的 PHP 教程,我发现我们可以使用 编写我们的 PHP 代码。也有标签,我试图弄清楚这和 之间的区别标签和优点或缺点,但没有找到任何东西,谁能告诉我区别。 提前致谢。 最佳答案 -6ren">
gpt4 book ai didi

php - 和 <script language ="php"></script> 的区别

转载 作者:可可西里 更新时间:2023-11-01 13:35:53 24 4
gpt4 key购买 nike

我只是浏览了那里的 PHP 教程,我发现我们可以使用 <script language="php"></script> 编写我们的 PHP 代码。也有标签,我试图弄清楚这和 <?php ?> 之间的区别标签和优点或缺点,但没有找到任何东西,谁能告诉我区别。

提前致谢。

最佳答案

我认为,就语义而言没有优点或缺点。根据PHP manual :

There are four different pairs of opening and closing tags which can be used in PHP. Two of those, <?php ?> and <script language="php"></script>, are always available.


另外,请注意:

If you are embedding PHP within XML or XHTML you will need to use the <?php ?> tags to remain compliant with standards.

无论如何,<?php ?>是最常用和推荐使用的。

注意:脚本标签 <script language="php"></script>和 ASP 标签 <% %>已从 PHP 7 中删除。

关于php - <?php ?> 和 &lt;script language ="php">&lt;/script&gt; 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9971611/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com