32, "Quagmire"=>30, "Joe"=>34要用array("Peter"=>32, "Quagmire"=>30"/> 32, "Quagmire"=>30, "Joe"=>34要用array("Peter"=>32, "Quagmire"=>30">
用array生成关联数组是括号内是字符串怎么办?
是这样的,从数据库中读出的值是:
"Peter"=>32, "Quagmire"=>30, "Joe"=>34
要用array("Peter"=>32, "Quagmire"=>30, "Joe"=>34),把它变为关联数组,但是都出来的值是字符串,有没有办法去除字符串的属性?或者有其他办法保存?
非常感谢!
------解决方案--------------------
<?php $str='"Peter"=>32, "Quagmire"=>30, "Joe"=>34';eval('$arr=array('.$str.');');print_r($arr);<div class="clear"> </div>