默认语法:
<h3>welcome!</h3> <?php echo "<p>动态标签输出!</p>"; ?> <p>静态标签输出!</p>
短标签
<? echo "this is short_tag"; ?>
短路语法
<?="this is short menthod!";?>
脚本
<script language="php">
print "this is php";
</script>
嵌入多个脚本块
<html> <head> <title><?echo "欢迎学习PHP"?></title> </head> <body> <? $date="2010-09-24"; ?> <p><?=$date;?></p> </body> </html>
单行C++风格代码注释
<?
//echo "this is scirpt";
?>
shell语法注释
<?
#echo "this is scirpt";
?>
多行C语言风格的注释
<?
/*
echo "this is scirpt";
echo "this is scirpt";
*/
?>