Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
指定フォルダ内にある.jpgを含むファイルをすべて表示する
<!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
You can’t perform that action at this time.