Jump to content

search (in PHP) inside folder & subfolders


azukah

Recommended Posts

does anybody know a way to use PHP to search a database inside specific folders and subfolders. i'm doing a knowledgebase type site and it will let users choose categories & subcategories. once those are chosen, i want to let them search with keywords inside the categories or subs (taht are actually the same as the folders and thier subs) ...?? any ideas???

Link to comment
https://forums.phpfreaks.com/topic/207668-search-in-php-inside-folder-subfolders/
Share on other sites

That will depend on the types of files that you have. PHP has native support for files with txt or html extensions. If your files are stored in this way you can use the files functions that php has to read files such as file(), file_get_contnets(), fread() then you can search the text using strstr(), stristr(), strpos(). You can also use regular expression to search the text if you want to add an extra layer of complexity to the results.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.