PHP中if语句的替代写法 在html中的用法 $a=1; <?php if($a==1): ?> //code...... <?php endif;?> 在html中的用法 <?php $var=true; ?> <html> <head> <title>php中的if语句的替代写法在html中的用法</title> </head> <body> <?php if($var): ?> ~~我可以运行 <?php endif;?> </body> </html>