<!--Example shows how to convert array to stdClass Object and how to access its value for display --><?php $num = array("Garha","sitamarhi","canada","patna"); $obj = (object)$num; echo "<pre>";print_r($obj); $newobj = new stdClass();$newobj->name = "India";$newobj->work = "Development";$newobj->address="patna";$new = (array)$newobj;echo "<pre>";print_r($new); $test = [Details=>['name','roll number','college','mobile'],values=>['Naman Kumar','100790310868','Pune college','9988707202']];$val = json_decode(json_encode($test),false);echo "<pre>";print_r($val);echo ((is_array($val) == true ? 1 : 0 ) == 1 ? "array" : "not an array" )."</br>"; echo ((is_object($val) == true ? 1 : 0 ) == 1 ? "object" : "not an object" );?>