This article introduces a piece of code that uses php to record search engine keywords. it is a good reference for beginners. Use php to record search engine search keywords. the code is as follows:
'Word', 'google. com '=> 'Q', 'sina .com.cn' => 'word', 'sohu. com '=> 'word', 'MSN. com '=> 'Q', 'Bing. com '=> 'Q', '2017. com '=> 'Q', 'Yahoo. com '=> 'P'); $ keyword = ''; $ sengine = $ p ['host']; foreach ($ arr_sd_key as $ se => $ kwd) {if (strpos ($ p ['host'], $ se )! = False) {$ keyword = $ pa [$ kwd]; $ sengine = $ se; break;} // write the search log $ SQL = "insert into visit_log (domain, key_word, ct) ";}?> The code is very simple, mainly to give you a thought: by analyzing the search engine source, intercepting the relevant parameter values in the url, then analyzing the keywords and matching the relevant search, and record it in the search log database. More related recordsSearch engine keywordsFor more information, see: php functions for retrieving search engine inbound keywords php record search engine paths and Keyword implementation code php code for retrieving search spider crawling records php search and display keyword examples php getting search engine keywords source (support for Baidu, Google, and other search engines) functions |