In PHP, why does [removed] not show a parse error?

前端 未结 2 1984
陌清茗
陌清茗 2021-01-30 00:48

I was running the following PHP code:


?>

There were no parse errors and the output was \"

2条回答
  •  梦毁少年i
    2021-01-30 01:11

    In PHP, you can use the script tag to open a PHP block.

    So you can use

    
    

    So in your example you have mixed the normal open tag, , with the closing tag, . So the parser assumes that all the text after the closing script tag is normal HTML.

    Read more in Escaping from HTML.

提交回复
热议问题