= 2) { // Get the last two parts of the host (e.g., "example.com") $domain = $hostParts[$numParts - 2] . '.' . $hostParts[$numParts - 1]; return $domain; } else { // If the host doesn't have at least two parts, return the entire host return $host; } } else { // If 'HTTP_HOST' is not set, return false return false; } } ?>
vimarsana; $newsdb = $db->news2021; $detect = new Mobile_Detect; $key = $_GET['country']; $key = str_replace("https:/","https://",$key); $key = str_replace("https:///","https://",$key); $key = str_replace("http:/","http://",$key); $key = str_replace("http:///","http://",$key); // echo "\r\n". $key; $fullurl = "https://" . $domain . "/article/" . str_replace(" ","+",$key); $amphtml = "https://" . $domain . "/amparticle/" . str_replace(" ","+",$key); //echo $key; $output = array(); $input = array("s"=> $key); $newsresults = $newsdb->findOne($input); if (isset($newsresults['u'])) { } else { $input = array("u"=> $key); $newsresults = $newsdb->findOne($input); } //$newsresults = $newsresults->getArrayCopy(); $k = 0; $imagefound = ""; $newsresultsarrays = array(); $keywordsarray = array(); $keywordstring = ''; if (isset($newsresults['i'])) { if (($newsresults['i'] != "") and ($imagefound == "")) { /// echo "© 2020. All Rights Reserved.