LoginSignup
3
3

More than 5 years have passed since last update.

phpで「配列」〜 array構文の使い方

Posted at

配列の書き方と要素の取り出し方。

以下の様に書いた場合の意味は
「azumanga」という変数に「"ちよ"〜"とも"」のいつもの6人を格納して、「0番目の"ちよ"を表示する」という文になります。



<html>
<head>
</head>
<body>

<?php  
$azumanga = array("ちよ", "かぐら", "おおさか", "さかき", "よみ", "とも");

echo $azumanga[0];

?>

</body>

</html>

以下、表示結果↓
php_array.png

3
3
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3