Several ways of writing php tags

Normal writing:

<?php echo hello; ?>

You can also omit ?> directly, directly

<?php echo hello;

Short tag writing:

<? echo hello; ?>

Need to open short_open_tag=On in php.ini

asp style writing

<% echo 1; %>

Need to open asp_tags=On in php.ini

Long tag writing

<script language="php"> echo 1; </script>

Notice

When the php code needs to be embedded in the XML file, use the first way of writing

Guess you like

Origin blog.csdn.net/weixin_57048716/article/details/128690815
Recommended