9951 explained code solutions for 126 technologies


phpConvert object to associative array


$arr = json_decode(json_encode($obj), true);ctrl + c
$arr

resulting array

json_decode

decodes JSON string

json_encode

encodes object to JSON string

$obj

object to covert to array

true

this will decode JSON to array