LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-20-2003, 07:40 PM   #1
paulish
LQ Newbie
 
Registered: Sep 2003
Location: Here.
Distribution: Red Hat 7.2
Posts: 1

Rep: Reputation: 0
Question perl opendir like function for php?


i was just wondering... is there a opendir and readdir function for php like there is in perl? or do i have to create a file with the names of all files within the folder to be able to see all files in a directory (sorry if that didn't make much sense). ?????

thanks,
paulish
 
Old 09-20-2003, 10:47 PM   #2
SaTaN
Member
 
Registered: Aug 2003
Location: Suprisingly in Heaven
Posts: 223

Rep: Reputation: 33
Code:
<html>
<title>
ls --- command
</title>
<?php
$all=shell_exec("ls directory_path");
$content=preg_split ("/\s+/", $all);
foreach ($content as $file)
print"$file <br>";
?>

</html>
I suppose this wud do this for you ....
 
Old 09-21-2003, 03:45 AM   #3
then
Member
 
Registered: Oct 2002
Location: FDR India
Distribution: RH9, Knoppix, MEPIS
Posts: 65

Rep: Reputation: 15
Hi

Quote:
is there a opendir and readdir function for php...
Think this is what you're looking for -
http://www.php.net/manual/en/ref.dir.php

regards
theN
ps: maybe the next time you'll search the manual before asking
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing one php function result as a parameter to another php function davee Programming 13 09-12-2004 12:08 PM
MD5, opendir, and other problems in Perl... KneeLess Programming 2 08-23-2004 02:15 PM
what are the Hexadecimal function and ASCII function in Perl Bassam Programming 1 06-03-2004 01:44 AM
Perl exec function in linux (and system-function) nazula Programming 1 04-19-2004 12:21 PM
chrooting apache v2 (php, ssl, perl support) ; perl configuration markus1982 Linux - Security 3 01-26-2003 06:15 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration