<?php
$folder = array();
foreach (glob("/*/*.mp4") as $filename) {
$folder[] = $filename;
}
for ($i = 0; $i < 10; ++$i) {
echo '
<div id="videoContainer">
<video width="320" height="240" controls>
<source src="'. $folder[$i] .'" type="video/mp4">
</video>
</div>
';
}
?>
This code gets all paths in subfolders with the type of mp4 file. At the end im going to count from 1-10 and echo out the path in the src part. Is there any better way to this without a database?
I would like to know how I can divide certain arrays by pages? As an example I would like to have only array 1-10 on page 1, 11-20 on page two etc. Any help would be appreciated.