php - Select files which name starts with some text -
php - Select files which name starts with some text -
how select list of files name starting "sometext_". have tried reading files , checking names string function. there improve way this?
answer :
$files = glob("files/sometext_*.txt"); print_r($files);
use glob function , see illustration in documentation
just changed illustration in documentation need
here code
foreach (glob("sometext_*") $filename) { echo "$filename size " . filesize($filename) . "\n"; }
php file
Comments
Post a Comment