Memory Refresh
Php



Array to object





You can call an array item like object property if you type cast array to object. <?php $arr = array('senderId' => 10); $obj = (object) $arr; echo $obj->senderId; // Outputs: 10 php.net/manual/en/language.types.object.php