2014年12月6日 星期六

[PHP網路編程從入門到精通]-3-6.php:宣告陣列並單一賦予值

[PHP網路編程從入門到精通]-3-6.php:宣告陣列並單一賦予值



  


<html>
<head>
<metahttp-equiv="Content-Type"content="text/html; charset=utf-8">
<title>3-6.php:宣告陣列並單一賦予值</title>
</head>
<body>
<?php
header("Content-Type:text/html; charset=utf-8");
//---------------------
$string[0]="string1";
$string[1]="string2";
$string[2]="string3";
$string[3]="string4";
$string[4]="string5";
for($i=0;$i<count($string);$i++)//利用count()計算陣列大小
{
echo$string[$i];
echo"<br>";
}
?>
</body>
</html>


















 






沒有留言:

張貼留言