There is no php.ini in the php compressed package I downloaded. I took one from Phpstudy and placed it in the root directory of the php decompression.
I typed a few lines of code and checked the effect of short_open_tag and asp_tags (the parsing status of short tags and asp tags) when they are turned on and off.
Please note here that if you modify the parsing status of the tag, you need to reopen PhpStorm, which is equivalent to restarting the server, to see the correct results.
Let’s take a look at the screenshots and code:
##
<html> <head> <title>titleTest</title> </head> <body> <!--下面是html--> 大家好,我是PHP新手iwanghang<br> 当源码没有php头(<?php ?>)的时候,php直接按照html解析<br><br><br> <的转移符是<<br> >的转移符是><br><br><br> <!--下面是php--> <?php echo "这里是php的代码<br>"; echo "生成到网页中,看不到php头<br><br><br>"; ?> <!--下面三种,一般不会用到,因为修改php.ini配置文件--> <!--如果服务器没有开启对应格式的解析,就会出错--> <!--下面是短标签--> <? echo "这里是短标签<br><br><br>"; ?> <? $str="hello<br><br><br>"; ?> <?=$str; ?> <!--下面是script--> <script language="php"> echo "这里是script<br><br><br>" </script> <!--下面是asp--> <% echo "这里是asp<br><br><br>" %> </body> </html>