2017-08-31 19 views
1

私は、この構造では、私の配列の滞在をしようとしている:私は2つの配列変更アレイ構造

に参加しようとした

array 
( 
    "url" => "http://localhost/theme/wp-content/uploads/2017/08/065.jpg" 
    "caption" => "test other capition" 
) 

array 
(
    0 => array (
     "url"=> "http://localhost/theme/wp-content/uploads/2017/08/img2.png" 
     "caption"=> "title text test" 
    ) 
) 

は、現在、私の配列は次のようになります

$first = array(); 
$NewArray = array($first, $urlsCaptions); 

出力:

array( 
    0 => array(), 
    1 => array(
    "url" => "http://localhost/theme/wp-content/uploads/2017/08/065.jpg" 
    "caption" => "test other capition" 
    ) 
) 

私の質問の最初の配列と同じ構造で、配列を正しく作成するにはどうすればよいですか?

+7

この '$ NEWARRAY =配列($ urlsCaptions)試してみてください;' –

+0

@SahilGulatiグレート、働いていました。 – Gislef

+0

ようこそ... :) –

答えて

0

これを試してみてください:

$arr = array ($originalArray);