function title.
Rewrite rules are consistent with WordPress.
Compatible with IIS, Apache, Nginx.
Only one file implements all functions.
- PHP
- if (Isset ($_GET[WD])) {
- $ keywords = $_get[wd];
- }
- $ URI = isset ($_server[http_x_rewrite_url])? $_server[http_x_rewrite_url]: $_server[request_uri];
- $ content = file_get_contents ("http://www.baidu.com". $uri);
- if ($uri==/| | empty ($uri)) {
- Display ($content);
- }
- Delete "to Baidu promotion" link
- $ Start = Preg_quote ("<Div class=" R ec_bdtg "> ");
- $ content = Preg_replace ("/". $start. " ((?! < BR > ).) *<br>"." /is ", $content);
- Delete Left auction
- $ Start = " ).) *> " ;
- $ content = Preg_replace_callback ("/". $start. " ((?! < /table > ).) *</table>/is "," Search_result_filter ", $content);
- //Delete the remaining multiple < BR >
- $ content = Str_ireplace ("<br><br> ",, $content);
- //Delete the remaining multiple < BR >
- $ content = Str_ireplace ("<br/> ", $content);
- Delete Right Promotion link
- $ Start = Preg_quote ("<Div id=" Ec_im_container "> ");
- $ content = Preg_replace ("/". $start. " ((?! < style ).) *"." /is ","<br /> div>", $ content);
- Display ($content);
- /**
- * Search Results Filter
- */
- function Search_result_filter ($matches) {
- The background #f5f5f5 is the advertisement
- if (strpos ($matches [0], "bgcolor=" #f5f5f5 ")) return;
- ID4 the number of digits is the advertisement
- if (Preg_match ("/<) Table (. *?) ID =\ "(d{4,}) \" (. *?) > ((?! < /table > ).) *</table>/is ", $matches [0])) {
- return;
- }
- return $matches [0];
- }
- function display ($content) {
- Echo $content;
- }
http://www.bkjia.com/PHPjc/486023.html www.bkjia.com true http://www.bkjia.com/PHPjc/486023.html techarticle function title. Rewrite rules are consistent with WordPress. Compatible with IIS, Apache, Nginx. Only one file implements all functions. PHP if (isset ($_GET[WD])) {$ keywords =$_get[wd];} $ uri = ...