Re: Wildcard search

From: Date: Fri, 08 Nov 2002 18:49:22 +0000
Subject: Re: Wildcard search
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-123458@lists.php.net to get a copy of this message
> If you're only executing one-liners and get all the > results back you're > better off using shell_exec(). popen() lets you open > a pipe to a > command--that way, you can funnel data to it as if > you were typing from the keyboard. That's what I'll do then: use shell_exec(). > Permissions would be a problem with readdir() as > well. So this really shouldn't be a deciding factor then. Anyway, I've got it working out. I have it returning an array of filenames if successful. If it's a successful call, but no files exists (for instance *.html with no HTML files), then it returns 0. If it can't read the directory or the dir doesn't exist, it returns NULL. Just to make sure, I can do this: if($files = GetFileListing("htmls\*.html")) { . . . } and it will skip it if there either are no HTML files, oe htmls doesn't exist, right? If I get a 0 or a NULL return? (I figure, if I need to distinguish between these two, I can always do a $==0 or $==NULL comparison). __________________________________________________ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2

« previous php.general (#123458) next »