Convert php stdobject to an array

From Code Trash

Jump to: navigation, search

Got this code from a website... it is just type casting and it is working...

		$str = stripslashes($this->input->post('str'));
		$str = json_decode($str);
 
		$str = (array)$str;
		$post = array_merge($str,$hdetails);
		$post = array_merge($post,array('rdetails'=>$rdetails));

References http://www.sitepoint.com/forums/showthread.php?438748-convert-object-to-array.

Personal tools
Google AdSense