- pathinfo: documentation ( source)
- print_r: documentation ( source)
- array_filter: documentation ( source)
<?php
$images = ['/tmp/php59iuBb', '/tmp/phpdRewVH', 'PicturesI.jpg', 'Screenshot.png'];
$images = array_filter($images, function ($image) {
return pathinfo($image, PATHINFO_DIRNAME) !== '/tmp';
});
print_r($images);