if ( preg_match ("/http.+duckduckgo\..+\/.+/" ,$vars["___url_http_referer"] ) ) { $searchengine = "DuckDuckGo"; $terms = $vars [ "q" ]; }