Is there a better/simpler way to find the number of images in a directory and output them to a variable?
function dirCount($dir) { $x = 0; while (($file
I use the following to get the count for all types of files in one directory in Laravel
$dir = public_path('img/'); $files = glob($dir . '*.*'); if ( $files !== false ) { $total_count = count( $files ); return $totalCount; } else { return 0; }