MemoryRefresh!

Array to object



Questions Answers 0%

Pages   0 from 51
Questions   0 from 84

Reset




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

Related pages

Definition !
Variable !
Check !
Type casting !
Array to object !
New object !


0% 100%
 
 
0 pages 51 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





Last Review: n/a   Passed: n/a   Reviews: n/a   Next Review: n/a  



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



More from Php

Basics
Variables
Operators
Function
Array
String
Streams
Uncategorized


More from Programming

Php
jQuery




Powered by minte9.com