Search Function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
winsonlee
Forum Commoner
Posts: 76
Joined: Thu Dec 11, 2003 8:49 pm

Search Function

Post by winsonlee »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Code: Select all

<?php
// include class
include("Find.php");

// initialize finder
$finder = new File_Find();

// search for matching files 
// in named directory and subdirectories
$results = $finder->search("/kd/i", "/Program Files/", "perl");


?>
I wonder with the find class, am i able to search for files that is located in network ??
My computer is map to another pc hard disk and it is name as Q: drive.
How am i perform a search on all the drives that maps on my computer ??


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

If it has a drive letter you should be able to search it by using the full path. In *nix environments, one could simply create a symbolic link.
Post Reply