I have study case want to show image from database from folder but the name in the database is not the same as the image file name, so it's like the %like% function (like in a query).
For example the file name: 1234_abcd_0.jpg
The data in the database is only: abcd.jpg
Can php Glob Work, если я использую как это? < /p>
$partnameoffile="abcd";
$dirname = "media/images/";
$images = glob($dirname."*".$partnameoffile."*.png");
foreach($images as $image) { echo '
'; }
Подробнее здесь: https://stackoverflow.com/questions/579 ... -file-name