"品牌1","type"=>"brand"), ar">
当前位置:Gxlcms > PHP教程 > php-PHP如何给这个数组里增加内容

php-PHP如何给这个数组里增加内容

时间:2021-07-01 10:21:17 帮助过:40人阅读

php数组

$brandData = array(
array('id'=> 1,'value'=> 388, "name"=> "品牌1","type"=>"brand"),
array("id"=> 2,"value"=> 205, "name"=> "品牌2","type"=>"brand"),
array("id"=> 3,"value"=> 215, "name"=> "品牌3","type"=>"brand"),
);
页面上会传递brand的value值
我想根据传递过来的值给相应的数组增加下面这个内容
,"selected"=>1

    例如:   array('id'=> 1,'value'=> 388, "name"=> "品牌1","type"=>"brand","selected"=>1),

人气教程排行