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);
?>