= 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; } } ?>
'; echo ''; } ?> vimarsana; $googledb = $db->google; $questionsdb = $db->questions; $descriptiondb = $db->description; $input = array('slug'=>$slug); $json = $googledb->findOne($input); if (isset($json['category'])) { $category = $json['category']; } else { $category = ''; } $questioninput = array("filename"=>$category); $questionsresults = array(); if ($category != "") { $questionsresults = $questionsdb->findOne($questioninput); } //$id = $json['id']; //$input = array('id'=>$id); $name = ''; if (isset($json['name'])) { $name = $json['name']; } $name = str_replace('"',' ',$name); $name = str_replace("'",' ',$name); $name = str_replace('"',' ',$name); $name = str_replace('|',' ',$name); $title = "Review ". ucwords($name); $finalkeywords = ''; if (isset($json['kw'])) { $keywords = $json['kw']; $count = 0; foreach($keywords as $keyword) { if ($count == 0) { $finalkeywords = ucwords(str_replace("-"," ",$keyword)); } else { $finalkeywords = $finalkeywords . "," . ucwords(str_replace("-"," ",$keyword)); } $count = $count + 1; } } $h1title = $title; if (isset($json['country'])) { $country = $json['country']; $h1title = $title . " In " . $country; } else { $country = ''; } if (isset($json['state'])) { $state = $json['state']; $h1title = $title . " In " . $state . ", " . $country; } else { $state = ''; } $likecount = 1; if (isset($json['likecount'])) { $likecount = $json['likecount'] + 1; } $dlikecount = 1; if (isset($json['dlikecount'])) { $dlikecount = $json['dlikecount'] + 1; } $totalrating = $likecount + $dlikecount ; $averagerating = round(($likecount / $totalrating),0); if ($averagerating < 1) { $averagerating = 1; } $image = ""; $images = array(); $images[0] = "https://" . $domain . "/images/vimarsana-bigimage.jpg"; $imagefound = "https://" . $domain . "/images/vimarsana-bigimage.jpg"; if (isset($json['image'])) { if ($json['image'] != "") { $pos = strpos($json['image'],$domain); if ($pos > 0) { $images[1] = $json['image']; $imagefound = $json['image']; } else { $image = "https://" . $domain . "/img/" . $json['image']; $images[1] = $image; $imagefound = $image; } } } $image = str_replace("https://vimarsana.com/vimarsana.com/","https://vimarsana.com/",$image); $image = str_replace("https://comparemela.com/comparemela.com/img/https:/vimarsana.com/img","https://comparemela.com/img",$image); if (isset($json['city'])) { $city = $json['city']; $h1title = $title . " In " . $city . ", " . $state . ", " . $country; } else { $city = ''; } if (isset($json['subdistrict'])) { $subdistrict = $json['subdistrict']; } else { $subdistrict = ''; } if (isset($json['zipcode'])) { $zipcode = $json['zipcode']; } else { $zipcode = ''; } if (isset($json['category'])) { $category = $json['category']; } else { $category = ''; } $description = ''; if (isset($json['description'])) { $description = $json['description']; } $description = str_replace('"',' ',$description); $title1 = $title; $title = substr($title,0,60); $description = "Review " . ucwords($name) . " ". ucwords($category) . " in " . ucwords($city) . ", ". ucwords($state) . ", ". ucwords($country) . ". Find Top Reviews For Any Location."; $description = substr($description,0,150); $keywords = "Review " . ucwords($name) . ", Review " . ucwords($category) . " in " . ucwords($city) . ", " . ucwords($state) . ", " . ucwords($country) ; $keywords = str_replace('"',' ',$keywords); $finalkeywords = str_replace('"',' ',$finalkeywords); ?>