Search engine technology core revealing (PHP)
Author: Sha rain Joined: 2004-03-11 Views: 234 Editor's note: This is a wonderful program teaching article not only analyzes how search engines in detail, the author also provides for the use of their own ??? ed Some ideas for search engines. The whole article is deeply in-depth, I believe that no matter whether it is a master or a rookie, it can get a lot of inspiration. When talking about web search engines, most people think of Yahoo. Indeed, Yahoo has created a search era of an internet network. However, Yahoo's technology currently used for searching web pages is not the company's original development. In August 2000, Yahoo used the technology of venture companies created by Google (www.google.com). Reasons are very simple, Google's search engine is more frequent and more accurately searching for the technology, more accurate search engine. Let us design it yourself, develop a strong, efficient search engine and database, I am afraid in a short period of technology, funds, etc., but since Yahoo is using others, then we can use others. Search engine website? Analysis of the programming idea we can envision: Simulate a query, send a search command to a search engine website, then return to the search result, analyze the results of the HTML code, strip unnecessary characters and code, and finally press the required needs The format is displayed in our own website page. In this way, the key to the problem is that we have to select an accurate search information (so our search will be more meaningful), fast speed (because we analyze search results and display an additional time), search results are simple ( Easy to perform HTML source code analysis and stripping) Search website, due to the various excellent features of the new generation of search engine Google, here we choose it as an example, let's see how to use PHP to implement the background to Google (www.google.com) Search, front desk personalization shows this process. Let's take a look at the composition of Google's query commands. Enter the www.google.com website, enter "ABCD" in the query bar, click the query button, we can find that the browser's address bar becomes: "http://www.google.com/search?q=abd&btng= Google% CB% D1% CB% F7 & HL = zh-cn & lr = ", it can be seen that Google is passed through the GET method of forms and submits the query command. We can use the file () function in the PHP to simulate this query process. Understand the File () function syntax: array file (string filename); return value is an array, read all the files into the array variable. The file here can be local or remote, and remote files must indicate the protocol used. For example: result = file ("http://www.google.com/search?q=abd&btng=google