| | |
Count Files in Server
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Dear All,
I am developing a Lease Management System and I have Stored LEase agreements in Folder Named LAPO
I used ID for search.
and in LAPO Folder I have created folders name like 9624
inside 9624, I have stored LA.pdf
There are 2300 folders in LAPO
and 95% of the Folders have LA inside.
1. I want to count these LA.pdf through PHP command or function.
Thanks.
2. Also I want the folder name in which LA.pdf exists.
I am developing a Lease Management System and I have Stored LEase agreements in Folder Named LAPO
I used ID for search.
and in LAPO Folder I have created folders name like 9624
inside 9624, I have stored LA.pdf
There are 2300 folders in LAPO
and 95% of the Folders have LA inside.
1. I want to count these LA.pdf through PHP command or function.
Thanks.
2. Also I want the folder name in which LA.pdf exists.
Ayesha
•
•
Join Date: Sep 2009
Posts: 525
Reputation:
Solved Threads: 61
0
#2 19 Days Ago
•
•
•
•
Dear All,
I am developing a Lease Management System and I have Stored LEase agreements in Folder Named LAPO
I used ID for search.
and in LAPO Folder I have created folders name like 9624
inside 9624, I have stored LA.pdf
There are 2300 folders in LAPO
and 95% of the Folders have LA inside.
1. I want to count these LA.pdf through PHP command or function.
Thanks.
2. Also I want the folder name in which LA.pdf exists.
PHP Syntax (Toggle Plain Text)
<?php $count = 0; if($handle = opendir('/path/to/dir/LAPO')) { echo "Directory handle: $handle\n"; echo "Files:\n"; /* This is the correct way to loop over the directory. */ while (false !== ($file = readdir($handle))) { is_dir($file) { if($handle_inner = opendir($file)) { while(false !== ($file_inner = readdir($handle_inner))) { echo "$file\n"; if($file_inner=='LA.pdf') { $count++; } } } }//is_dir } closedir($handle); } echo "Number of LA.pdf found inside".$count; ?>
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
![]() |
Similar Threads
- How to count files of particular type (like *.txt) in a folder (Python)
- Copy Local files into server (C#)
- list selected files on MySQL server (PHP)
- count selected files (VB.NET)
- Help on Deleting files from server- no database (PHP)
- How to count folder files using php (PHP)
- Hidden files.. Server not even kissed (Viruses, Spyware and other Nasties)
- Having accounts store files on server (Windows NT / 2000 / XP)
Other Threads in the PHP Forum
- Previous Thread: getting variable without extension
- Next Thread: Making tutorials - your wishlist
| Thread Tools | Search this Thread |
ajax apache api array basics beginner binary broken cakephp checkbox class cms code codingproblem combobox cron curl database date display domain dynamic echo email error file files folder form format forms function functions google href htaccess html image include insert interactive ip java javascript joomla js limit link load login mail malfunctioning menu mlm mobile multiple mysql nodes oop outofmemmory paging parse paypal pdf php problem procedure query radio ram random recursion reference remote return script search server sessions sms source space sql syntax system table tutorial unset up-to-date update upload url validation validator variable video web webapplications websitecontactform youtube





