/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//dealing with encapsulation.... class MemCache{ private $mem; public function MemCache(){ //some intitialization here... } public function get($key){ return $this->mem[$key]; //else echo "Huston we have a problem!"; } public function set($key, $val){ echo "Huston...just to let you know that an override occurs here to $key with val: $val"; $this->mem[$key] = $val; } }
Comments
