나는 하루 종일 두 개의 연관 배열을 병합하려했습니다. 하지만 PHP에서 가능한지 여부는 알 수 없습니다.PHP에서 두 개의 연관된 배열을 병합하는 방법
제 배열
'images' =>
0 =>
'image_first' => string 'http://10.0.2.2/captcha-2/iphone.png'
1 =>
'image_first' => string 'http://10.0.2.2/captcha-2/1425328_405486846250283_806381377_o.jpg'
2 =>
'image_first' => string 'http://10.0.2.2/captcha-2/bbg.jpg'
3 =>
'image_first' => string 'http://10.0.2.2/captcha-2/gmail_bg.JPG'
2 어레이
'images' =>
0 =>
'image_second' => string 'http://10.0.2.2/captcha-2/Capture.JPG'
1 =>
'image_second' => string 'http://10.0.2.2/captcha-2/bg.jpg'
2 =>
'image_second' => string 'http://10.0.2.2/captcha-2/abc.JPG'
3 =>
'image_second' => string 'http://10.0.2.2/captcha-2/bg_dark.png'
4 =>
'image_second' => string 'http://10.0.2.2/captcha-2/bktile.png'
그리고 이렇게 병합한다.
병합 된 배열
'images' =>
0 =>
'image_first' => string 'http://10.0.2.2/captcha-2/iphone.png'
1 =>
'image_first' => string 'http://10.0.2.2/captcha-2/1425328_405486846250283_806381377_o.jpg'
2 =>
'image_first' => string 'http://10.0.2.2/captcha-2/bbg.jpg'
3 =>
'image_first' => string 'http://10.0.2.2/captcha-2/gmail_bg.JPG'
4 =>
'image_second' => string 'http://10.0.2.2/captcha-2/Capture.JPG'
5 =>
'image_second' => string 'http://10.0.2.2/captcha-2/bg.jpg'
6 =>
'image_second' => string 'http://10.0.2.2/captcha-2/abc.JPG'
7 =>
'image_second' => string 'http://10.0.2.2/captcha-2/bg_dark.png'
8 =>
'image_second' => string 'http://10.0.2.2/captcha-2/bktile.png'
그것을 어떻게?
[array_merge] (http://de2.php.net/manual/en/function.array-merge.php) - 문서를 참조한 적이 있습니까? – ccKep
array_merge 이외의 결과를 원하십니까? 그렇다면 결과를 내놓을뿐만 아니라 결과물을 제공해야합니다. –
진지하게? https://www.google.com/search?q=php+merge+two+array – AbraCadaver