Is there a way to make a read-only property of an object in PHP? I have an object with a couple arrays in it. I want to access them as I normally would an array
<
in the class, do this:
private $array; function set_array($value) { $this->array = $value; }
then you just set like this:
$obj->set_array($new_array);