[ create a new paste ] login | about

Link: http://codepad.org/dQ8r52Eq    [ raw code | output | fork ]

PHP, pasted on Jan 11:
<?php
$return_arr = array();

$company_arr = array(
    (int) 0 =>  array(
            'id' => '19',
            'group_id' => '1',
            'name' => 'Harts Harts',
            'address' => 'xxx NE xxxth Street',
            'city' => 'Shoreline',
            'state' => 'WA',
            'zip' => '98155',
            'country' => '',
        ),
    (int) 1 => array(
            'id' => '21',
            'group_id' => '1',
            'name' => 'Andy Robin',
            'address' => 'xxx xxxth Ave NE',
            'city' => 'Bellevue',
            'state' => 'WA',
            'zip' => '98004',
            'country' => '',
        )
);

foreach ($company_arr as &$company) {
    array_push($return_arr,$company);
}


echo json_encode($return_arr);
?>


Output:
1
[{"id":"19","group_id":"1","name":"Harts Harts","address":"xxx NE xxxth Street","city":"Shoreline","state":"WA","zip":"98155","country":""},{"id":"21","group_id":"1","name":"Andy Robin","address":"xxx xxxth Ave NE","city":"Bellevue","state":"WA","zip":"98004","country":""}]


Create a new paste based on this one


Comments: