数组: $arr =array( '0' => array('id'=>1,'prize'=>'积分100分','v'=>1), '1' => array('id'=>2,'prize
数组:$arr=array('0'=>array('id'=>1,'prize'=>'积分100分','v'=>1),'1'=>array('id'=>2,'prize'...
数组:
$arr =array(
'0' => array('id'=>1,'prize'=>'积分100分','v'=>1),
'1' => array('id'=>2,'prize'=>'积分50分','v'=>2),
'2' => array('id'=>3,'prize'=>'积分20分','v'=>7),
'3' => array('id'=>4,'prize'=>'积分10分','v'=>10),
'4' => array('id'=>5,'prize'=>'积分5分','v'=>80),
'5' => array('id'=>6,'prize'=>'道具卡','v'=>900),
);
我想改造成数组内容赋值的形式:
$zf = "'0' => array('id'=>1,'prize'=>'积分100分','v'=>1),
'1' => array('id'=>2,'prize'=>'积分50分','v'=>2),
'2' => array('id'=>3,'prize'=>'积分20分','v'=>7),
'3' => array('id'=>4,'prize'=>'积分10分','v'=>10),
'4' => array('id'=>5,'prize'=>'积分5分','v'=>80),
'5' => array('id'=>6,'prize'=>'道具卡','v'=>900),
";
$arr =array(
$zf
);
这样写不行,数组不能正常工作,请教高手指点下? 展开
$arr =array(
'0' => array('id'=>1,'prize'=>'积分100分','v'=>1),
'1' => array('id'=>2,'prize'=>'积分50分','v'=>2),
'2' => array('id'=>3,'prize'=>'积分20分','v'=>7),
'3' => array('id'=>4,'prize'=>'积分10分','v'=>10),
'4' => array('id'=>5,'prize'=>'积分5分','v'=>80),
'5' => array('id'=>6,'prize'=>'道具卡','v'=>900),
);
我想改造成数组内容赋值的形式:
$zf = "'0' => array('id'=>1,'prize'=>'积分100分','v'=>1),
'1' => array('id'=>2,'prize'=>'积分50分','v'=>2),
'2' => array('id'=>3,'prize'=>'积分20分','v'=>7),
'3' => array('id'=>4,'prize'=>'积分10分','v'=>10),
'4' => array('id'=>5,'prize'=>'积分5分','v'=>80),
'5' => array('id'=>6,'prize'=>'道具卡','v'=>900),
";
$arr =array(
$zf
);
这样写不行,数组不能正常工作,请教高手指点下? 展开
2个回答
展开全部
$zf = "'0' => array('id'=>1,'prize'=>'积分100分','v'=>1),
'1' => array('id'=>2,'prize'=>'积分50分','v'=>2),
'2' => array('id'=>3,'prize'=>'积分20分','v'=>7),
'3' => array('id'=>4,'prize'=>'积分10分','v'=>10),
'4' => array('id'=>5,'prize'=>'积分5分','v'=>80),
'5' => array('id'=>6,'prize'=>'道具卡','v'=>900)";
eval("\$arr = array(".$zf.');');
print_r($arr);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询