// Set our variables $page = $_SERVER['PATH_INFO']; $page = substr_replace($page, '', 0, 1); $title = $page; $page = $page . ".html"; if ($page == ".html") { $page = "multifamily-interiors.html"; $title = "multifamily-interiors"; } $title = strToTitleCase(str_replace("-", " ", $title)); // Take the page uri and turn it title case so we don't have to continue to modify the HTML Title ourselves... inginous! function strToTitleCase($title) { $smallwordsarray = array( 'of','a','the','and','an','or','nor','but','is','if','then','else','when', 'at','from','by','on','off','for','in','out','over','to','into','with' ); $words = explode(' ', $title); foreach ($words as $key => $word) { if ($key == 0 or !in_array($word, $smallwordsarray)) $words[$key] = ucwords($word); } $newtitle = implode(' ', $words); return $newtitle; echo $newtitle; } // Load the page... provided it exists function loadPage($page) { if (!file_exists($page)) { $error = "error.html"; include($error); } else { include($page); } } ?>