MemoryRefresh!

Variables / Array to object   Array to object



Questions Answers 0%

Pages   0 from 91
Questions   0 from 142

Reset



<?php $arr = array('senderId' => 10); $obj = (object) $arr; // --- Look Here --- // echo $obj->senderId; // Outputs: 10 php.net

Related Pages

Definition
Variable
Check
Type casting
Array to object
New object


0% 100%
 
 
0 pages 91 pages
1) Can you call an array item like object property?




2) What is the missing part? <?php $arr = array('senderId' => 10); .... echo $obj->senderId; // Outputs: 10









<?php $arr = array('senderId' => 10); $obj = (object) $arr; // --- Look Here --- // echo $obj->senderId; // Outputs: 10 php.net

References









Programming

Php
   
Regex
   
MySQL
   
Css
   
jQuery
   
Git
   


References