php脚本的后面名为.php,代码放置在下面的括号里面:
<"htmlcode"><"hallo world"; "htmlcode"><"htmlcode"><!DOCTYPE html> <html> <body> <"Hello World!<br>"; echo "Hello World!<br>"; EcHo "Hello World!<br>"; "htmlcode"><"red"; $Color="black"; echo "my car is " . $color . "<br>"; echo "my car is " . $Color . "<br>"; "htmlcode"><"<p>测试函数内部的变量:</p>"; echo "变量 x 是:$x"; echo "<br>"; echo "变量 y 是:$y"; } myTest(); echo "<p>测试函数之外的变量:</p>"; echo "变量 x 是:$x"; echo "<br>"; echo "变量 y 是:$y"; "htmlcode"><"htmlcode"><"htmlcode"><"htmlcode"><"Hello world!","world"); "htmlcode"><"GREETING", "Welcome to W3School.com.cn!"); echo GREETING; "htmlcode"><"H"); if ($t<"10") { echo "Have a good morning!"; } elseif ($t<"20") { echo "Have a good day!"; } else { echo "Have a good night!"; } "htmlcode"><"Number 1"; break; case 2: echo "Number 2"; break; case 3: echo "Number 3"; break; default: echo "No number between 1 and 3"; } "htmlcode"><"red","green","blue","yellow"); foreach ($colors as $value) { echo "$value <br>"; } "function" 开头:function functionName() {
被执行的代码;
}
举个例子:<"Hello world!"; } writeMsg(); // 调用函数 "$fname Zhang. Born in $year <br>"; } familyName("Li","1975"); familyName("Hong","1978"); familyName("Tao","1983"); "The height is : $minheight <br>"; } setHeight(350); setHeight(); // 将使用默认值 50 setHeight(135); setHeight(80); "5 + 10 = " . sum(5,10) . "<br>"; echo "7 + 13 = " . sum(7,13) . "<br>"; echo "2 + 4 = " . sum(2,4); "htmlcode">$cars=array("Volvo","BMW","SAAB"); <"Volvo","BMW","SAAB"); echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . "."; "Volvo","BMW","SAAB"); echo count($cars); "Volvo","BMW","SAAB"); $arrlength=count($cars); for($x=0;$x<$arrlength;$x++) { echo $cars[$x]; echo "<br>"; } "htmlcode">$age=array("Peter"=>"35","Ben"=>"37","Joe"=>"43");或
$age['Peter']="35"; $age['Ben']="37"; $age['Joe']="43"; <"Bill"=>"35","Steve"=>"37","Peter"=>"43"); echo "Peter is " . $age['Peter'] . " years old."; "Bill"=>"35","Steve"=>"37","Peter"=>"43"); foreach($age as $x=>$x_value) { echo "Key=" . $x . ", Value=" . $x_value; echo "<br>"; } "htmlcode"><"Bill"=>"35","Steve"=>"37","Peter"=>"43"); asort($age); "Bill"=>"35","Steve"=>"37","Peter"=>"43"); ksort($age); "post" 的 HTML 表单后的表单数据。也常用于传递变量。$_GET:$_GET 也可用于收集提交 HTML 表单 (method="get") 之后的表单数据。 $_FILES $_ENV $_COOKIE $_SESSION 其他内容可以在表单处理中找到。
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!暂无评论...更新日志
2024年11月27日2024年11月27日
- 凤飞飞《我们的主题曲》飞跃制作[正版原抓WAV+CUE]
- 刘嘉亮《亮情歌2》[WAV+CUE][1G]
- 红馆40·谭咏麟《歌者恋歌浓情30年演唱会》3CD[低速原抓WAV+CUE][1.8G]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[320K/MP3][193.25MB]
- 【轻音乐】曼托凡尼乐团《精选辑》2CD.1998[FLAC+CUE整轨]
- 邝美云《心中有爱》1989年香港DMIJP版1MTO东芝首版[WAV+CUE]
- 群星《情叹-发烧女声DSD》天籁女声发烧碟[WAV+CUE]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[FLAC/分轨][748.03MB]
- 理想混蛋《Origin Sessions》[320K/MP3][37.47MB]
- 公馆青少年《我其实一点都不酷》[320K/MP3][78.78MB]
- 群星《情叹-发烧男声DSD》最值得珍藏的完美男声[WAV+CUE]
- 群星《国韵飘香·贵妃醉酒HQCD黑胶王》2CD[WAV]
- 卫兰《DAUGHTER》【低速原抓WAV+CUE】
- 公馆青少年《我其实一点都不酷》[FLAC/分轨][398.22MB]
- ZWEI《迟暮的花 (Explicit)》[320K/MP3][57.16MB]