看了些PHP的基础知识,自己在这里总结下:
1、在HTML嵌入PHP脚本有三种办法:
<scriptlanguage="php"> //嵌入方式一 echo("test"); </script> <? //嵌入方式二 echo"<br>test2"; ?> <?php //嵌入方式三 echo"<br>test3"; ?> |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
<? $a=1; functiontest(){ echo$a; } test();//这里将不能输出结果“1”。 functiontest2(){ global$a; echo$a; } test2();//这样可以输出结果“1”。 ?> |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
<? $a[0]="abc"; $a[1]="def"; $b["foo"]=13; $a[]="hello";//$a[2]="hello" $a[]="world";//$a[3]="world" $name[]="jill";//$name[0]="jill" $name[]="jack";//$name[1]="jack" ?> |
![]() ![]() ![]() ![]()
http://www.bkjia.com/PHPjc/508486.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/508486.htmlTechArticle看了些PHP的基础知识,自己在这里总结下: 1、在HTML嵌入PHP脚本有三种办法: <scriptlanguage=php> //嵌入方式一 echo(test); </script> <? //嵌入...
|