Hi,
I want to write a simple script that looks for all the files with a common
name and show them, like all the .mp3 files or all the .doc files. How do I
go about it?
Thank you,
-Pooya
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
http://www.php.net/readdir
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
But how do I get all the .mp3 files? can I use *.mp3? and how ?
Matt Matijevich [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
http://www.php.net/readdir
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
on that page ther is examples
?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ($file != . $file != ..) { //add your logic to see if
it is an .mp3 file right here, that can be done any number of ways
echo $file\n;
}
}
That is exactly my question! how do I look for a .mp3 file?!
I tried
if ($file != . $file != .. $file==*.mp3)
but it doesn't work!
Matt Matijevich [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
on that page ther is examples
?php
if ($handle = opendir('.')) {
while (false
On Sat, 2004-04-17 at 12:35, Pooya Eslami wrote:
That is exactly my question! how do I look for a .mp3 file?!
I tried
if ($file != . $file != .. $file==*.mp3)
but it doesn't work!
if( eregi( '\.mp3$', $file ) )
Cheers,
Rob.
--
Thank you Robert.
Robert Cummings [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Sat, 2004-04-17 at 12:35, Pooya Eslami wrote:
That is exactly my question! how do I look for a .mp3 file?!
I tried
if ($file != . $file != .. $file==*.mp3)
but it doesn't work!
if( eregi(
7 matches
Mail list logo