How can I convert an array like this to an object?
[128] => Array
(
[status] => "Figure A.
Facebook\'s horizontal scrollbars showing u
You can use the (object) function to convert your array into an object.
$arr= [128=> ['status'=>
'Figure A. Facebook \'s horizontal scrollbars showing up on a 1024x768 screen resolution.'],
129=>['status'=>'The other day at work, I had some spare time']];
$ArrToObject=(object)$arr;
var_dump($ArrToObject);
The result will be an object that contains arrays:
object(stdClass)#1048 (2) { [128]=> array(1) {
["status"]=> string(87) "Figure A. Facebook 's horizontal scrollbars showing up on a 1024x768 screen resolution." }
[129]=> array(1) { ["status"]=> string(44) "The other day at work, I had some spare time" } }