6CC001 Workshop - week 03
From mi-linux
Jump to navigationJump to searchMain Page >> Web Application Development >> Workbook >> Week 03
Static classes - An example
class Preferences { private static $values = array(); static function set($key, $val) { self::$values[$key] = $val; } static function get($key) { return self::$values[$key]; } }
Preferences::set("db_server", "mi-linux");
$db_server = Preferences::get("db_server"); echo $db_server;