Created
July 2, 2015 01:37
-
-
Save nnsnodnb/179a95d0cf497dedd776 to your computer and use it in GitHub Desktop.
指定フォルダ内にある.jpgを含むファイルをすべて表示する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>画像をある分だけ表示する</title> | |
</head> | |
<body> | |
<?php | |
$count = 0; | |
$files = count(glob("/img/*.jpg")); | |
echo "<p>while文</p>"; | |
while ($count <= $files) { | |
echo "<img src='img/$count.jpg' alt='' />"; | |
echo "<br>"; | |
$count++ ; | |
} | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment