在php中按索引拆分数组值

时间:2017-06-06 06:00:21

标签: php mysql arrays split

我有两个数组

一个是$ array,包括post data response,

另一个是$ imagearray,它只包含图像值

这里我的输出,$数组有后期值

array(4) {
["selected"]=> string(4) "test" 
["priority"]=> string(1) "1" 
["matter_title"]=> string(3) "wet" 
["matter_description"]=> string(3) "wet"
}

第二个数组只有图像值,

array(1) {
[0]=> array(3) { 
[0]=> "3.png" 
[1]=> "4.png" 
[2]=> "2.png"
   } 
}

了解更多:

序列是那个

array([0]=[0]=image1,[1]=title1,[2]=des1)
array([1]=[0]=image2,[1]=title2,[2]=des2)

为此我申请了

$a = array($matterarray);   //call image array value
$b = array($array);    //call post value

$d = array_map(null, $a, $b);  //map both value
print_r($d);

输错了。请帮帮我。

 Array ( [0] => Array ( [0] => Array ( [0] => 1.png [1] => 3.png [2] => 1.png ) 
[1] => Array ( [0] => one [1] => two )) 
[1] => Array ( [0] => [1] => Array ( [0] => three [1] => four )
[2] => Array ( [0] => [1] => [2] => tres ) )

0 个答案:

没有答案