Jump to content

Count number or files in a directory script


adamriley

Recommended Posts

Ok changed it a little but get

 

----------------------------------

 

Warning: Division by zero in C:\xampp\htdocs\Admin\Test.php on line 2

 

Warning: Division by zero in C:\xampp\htdocs\Admin\Test.php on line 2

4

----------------------------------

Changed to

----------

 

<?php
$dir_path = $_SERVER["DOCUMENT_ROOT"]/admin/images;
$count = count(glob($dir_path . "*"));
echo $count;
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.