= 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; } } ?> $country); $countrydetail = str_replace("-"," ",$country); $title = "Top " . ucwords($countrydetail) . " | Reviews & Ratings | ". $domain ; $description = "Discover the best " . ucwords($countrydetail) . ". Read reviews, rate locations, and find trusted local businesses with Vimarsana.com."; $keywords = "Review Locations & Business In ". $countrydetail ; $sitename = "https://" . $domain ; //echo "\r\n" . "Title is - ". $title; $type = "website"; $fbpages = ""; $fbappid = ""; $googlesite = ""; $keywords = "review, celebrity review, movie review, location review"; ?> <?php echo ucwords($title) ?>
isMobile()) or ($detect->isTablet())) { } else { if (( $domain == "vimarsana.com") and ($adsshow == 1)) { echo ' '; } } ?>
Top Locations Tagged with ' . ucfirst(str_replace("-"," ",$country)) .""; $mongoCon = new MongoDB\Client("mongodb://127.0.0.1:27017/?socketTimeoutMS=5000"); $db = $mongoCon->vimarsana; $googledb = $db->google; $tagkeywordsdb = $db->tagkeywords; $input = array("k"=>$country); $countries = $tagkeywordsdb->findOne($input); $set = 0; if (isset($countries['d'])) { $set = 1; $countries = $countries['d']; } else { // $selection = array('projection'=>array('country'=>1,'category'=>1,'state'=>1,'city'=>1,'placename'=>1,'zipcode'=>1,'name'=>1,'slug'=>1)); // $input = array('kw'=>$country); // $countries = $googledb->find($input,array("limit"=>100),$selection); } $json = array(); $json['@context'] = "http://schema.org"; $json['@type'] = 'ItemList'; $localjson = array(); $v = 0; $localjson[$v]['@context'] = 'http://schema.org'; $localjson[$v]['@type'] = 'Organization'; $localjson[$v]['name'] = $domain; $localjson[$v]['url'] = 'https://' . $domain ; $localjson[$v]['logo'] = 'https://' . $domain . '/images/xlogo-light-icon-favicon.png.pagespeed.ic.A0aAkN5BNI.webp'; $k = 0; $preindex = ""; if ($set == 1) { foreach($countries as $countrie) { $country = str_replace("-"," ",$countrie['country']); $zipcode = $countrie['zipcode']; $name = $countrie['name']; $slug = $countrie['slug']; // $state = $countrie['state']; $jsonurl = "https://" . $domain . "/review/" . $slug; $indexname = ucfirst($keywordfromslug) . " in " . ucfirst($country) . " - " . $zipcode; if ($preindex != $indexname) { if ($k == 0) { echo '

'; } else { echo '

'; } $category = ""; if (isset($coutrie['category'])) { $category = $coutrie['category']; } if ((isset($countrie['placename'])) and ($countrie['placename'] != "")) { // echo '

' . $indexname . "/" . ucfirst($category) . " near " . $countrie['placename'] . "/" . ucfirst($countrie['category']) . " near " . $countrie['city'] . '

'; echo "

" . $indexname . "/" . ucfirst($category) . " near " . $countrie['placename'] . "/" . ucfirst($countrie['category']) . " near " . $countrie['city'] . "

"; } else { // echo '

' . $indexname . "/" . ucfirst($category) . " near " . $countrie['city'] . '

'; echo "

" . $indexname . "/" . ucfirst($category) . " near " . $countrie['city'] . "

"; } echo '
'; } $v = $k + 1; $name = str_replace("," ,", ",$name); echo ""; $preindex = $indexname; $json['itemListElement'][$k]['@type'] = 'ListItem'; $json['itemListElement'][$k]['position'] = $k; $json['itemListElement'][$k]['url'] = $jsonurl; $k = $k + 1; } } echo '
'; $localjson = json_encode($localjson); $json = json_encode($json); ?>
' . $websitejson . '' ; echo ''; echo ''; echo ''; echo ''; echo ''; } ?>