Search Engine [PHP]
Download Source CodeSearchEngine.20191015-2137.zip [Downloads: 243]
This script searches in a specified directory and down through all subdirectories and files for the given search word or phrase, which can be input as a regular string or a regular expression (regex). The script searches in all filenames and in content for filtypes specified in the script. Only files below a specified maximum size are opened and searched in. The search results are listed as links with a short preview of the matched content and info on the number of matches.
Known limitations: the script only works for (smaller) sites where all content is stored in files and not in a database. The PHP engine's default timeout is 30 seconds and if the script doesn't finish before this it will be terminated with an error. Depending on the webhost's policy it might be possible to extend this with
You can try the search engine in action here on my site: Search my Site.
Example of Usage
<title>Search Engine Example</title>
<meta charset="UTF-8" />
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
$se = new com\dunweber\searchengine\SearchEngine('.'); // Current dir and down