| | |
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: 557
Reputation:
Solved Threads: 64
0
#2 Nov 10th, 2009
•
•
•
•
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
Views: 181 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl customizableitems database date directory display download dynamic echo email error file files folder form format forms forum function functions google headmethod href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail malfunctioning menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table tutorial update updates upload url validation validator variable video web xml youtube





