Sample code for 30+ languages & platforms
PHP

AppendArrayItems Example

Demonstrates the AppendArrayItems function.

Note: This example requires Chilkat v9.5.0.82 or above.

Chilkat PHP Downloads

Chilkat2 PHP
<?php

use Chilkat2\JsonArray;

$jarr1 = new JsonArray();
$jarr1->Load('[ 1, 2, 3, 4]');

$jarr2 = new JsonArray();
$jarr2->Load('[ 5, 6, 7, 8]');

$jarr1->AppendArrayItems($jarr2);

echo $jarr1->Emit(), "\n";
// Expected output: [1,2,3,4,5,6,7,8]

echo $jarr2->Emit(), "\n";
// Expected output: [5,6,7,8]