im trying to do this :
$filename = "/destination/destination2/file_*";
" * " = anything
destination2 files :
file_somethingrandom
and since it $filename contains * so it should be selecting file_somethingrandom
how to do it?
Use the glob()
function like this:
$filename = "/destination/destination2/file_*";
foreach (glob($filename) as $filefound)
{
echo "$filefound size " . filesize($filefound) . "\n";
}
Try this
foreach (glob("/destination/destination2/file_*") as $filename) {
echo $filename;
}
Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With