이것은 단지 당신이 그것을 할 수있는 방법의 간단한 예를 들어, 당신은 그러나 당신이 좋아 따라이를 개선 할 수있다 어떤 상황이 필요한지.
// Initialising arrays
$array1 = ['type' => 'column', 'valueField' => '.1.', 'descriptionField' => '.11.'];
$array2 = ['type' => 'column', 'valueField' => '.2.', 'descriptionField' => '.22.'];
// Turn them manually into jsons
$obj1 = json_encode($array1);
$obj2 = json_encode($array2);
// Merge the two jsonified arrays in a single array with whichever keys you prefer
$mix = ['array1' => $obj1, 'array2' => $obj2];
// Turn the merged "mix" array into json
$mix = json_encode($mix);
// Check the output
printf($mix);
/* Prints out:
{
"array1":"{"type":"column", "valueField":".1.", "descriptionField":".11."}",
"array2":"{"type":"column", "valueField":".2.", "descriptionField":".22."}"
}
*/
당신이 SANDBOX에서의 그것으로 주변에 바이올린 수는, 그것으로 재미 좀.
코드를 표시하고 결과로 원하는 것은 무엇입니까? 당신은 당신의 시도로 어떤 결과를 얻고 있습니까? 또한, [How to ask] (http://stackoverflow.com/help/how-to-ask) – Nytrix
'$ result = "[$ array1, $ array2]"에 대해 읽어야합니다. 어쩌면 – AbraCadaver