//core-loader.php //Load content handler. require_once("csContentHandler2.php"); $object = new csContentHandler(); echo $object->saContent[1]; //csContentHandler.php class csContentHandler { public static $szWebSiteGroupDetails = ""; public $saContent = ""; //An array containing the client requested content and data corresponding to it. public $szExternalPHPMainContentPage = ""; //Contains an external PHP file and content that replaces the default page template and is used for the entire page. public $szDocumentRoot = ""; public static $szFoo = ""; public function __construct() { self::$szWebSiteGroupDetails = "HTML Header Title Here"; self::$szFoo = "Bye Bye"; $this->szExternalPHPMainContentPage .= $this->fnGetFileContents("/var/www/htdocs/venmar/includes/page-repdir2.php"); $this->saContent[1] = $this->szExternalPHPMainContentPage; $nInt = 1; switch($nInt) { case 1: self::$szFoo = "Hello World"; break; } } private function fnGetFileContents($szFilename) { if(is_file($szFilename)) { ob_start(); include("$szFilename"); $szContents = ob_get_contents(); ob_end_clean(); return $szContents; } return false; } } //page-repdir2.php //Load content handler. require_once("csContentHandler2.php"); //echo csContentHandler::$szWebSiteGroupDetails; echo csContentHandler::$szFoo;