Briefly describe what php tags are

(*-*)浩
Release: 2023-02-23 19:26:01
Original
5155 people have browsed it

Briefly describe what php tags are

## is the parser (long tag) of PHP. All code that needs to be run must be placed in the parser.

<?php
echo "hello world";
?>
Copy after login

Short tag<% %> (Recommended learning: PHP Programming from Beginner to Master)

Short tags are only used to output variables or expressions. The general usage is

<?=$a?>
<?=(表达式)?>
Copy after login

, which is equivalent to

<?php echo $a?>
<?php echo (表达式)?>
Copy after login

. It does not support structures such as if and for.

If you write

<?if(...?>
Copy after login

, it will become

<!--if(...-->
Copy after login

. Open the short tag. Open the short tag in PHP.INI: short_open_tag = On, PHP default tag character < ;?php ?>

So you must use long tags when writing programs, and short tags will be used when inserting output into html.

The above is the detailed content of Briefly describe what php tags are. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template