php:jsobject2array
<?php
/**
* js对象转换成数组
* @param $str
* @return mixed
*/
function jsobj2array($str) {
$str = trim($str);
$str = rtrim($str, ';');
$str = preg_replace('/([\{,\[])([a-z_A-Z\-]*?):/', '$1"$2":', $str);
return (json_decode($str, true));
}