[ create a new paste ] login | about

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

PHP, pasted on Apr 16:
<?php

$arr = array();

$arr['items'][0]['SKU'] = 'GM24ER';
$arr['items'][0]['brand_text'] = 'Replacement';
$arr['items'][0]['shipping_date'] = '2018-04-30';
$arr['items'][0]['source_zipcode'] = 92641;
$arr['items'][0]['vendor_name'] = 'USAP LSL';
$arr['items'][0]['GUID'] = '12qws';
$arr['items'][0]['lead_time'] = '1 day';
$arr['items'][0]['transit_time'] = '7 days';


$arr['items'][1]['SKU'] = 'GM24EL';
$arr['items'][1]['brand_text'] = 'Replacement';
$arr['items'][1]['shipping_date'] = '2018-04-30';
$arr['items'][1]['source_zipcode'] = 92641;
$arr['items'][1]['vendor_name'] = 'USAP VA';
$arr['items'][1]['GUID'] = '12qws';
$arr['items'][1]['lead_time'] = '1 day';
$arr['items'][1]['transit_time'] = '7 days';

print_r($arr);

echo "<br>";

echo json_encode($arr);
?>


Output:
Array
(
    [items] => Array
        (
            [0] => Array
                (
                    [SKU] => GM24ER
                    [brand_text] => Replacement
                    [shipping_date] => 2018-04-30
                    [source_zipcode] => 92641
                    [vendor_name] => USAP LSL
                    [GUID] => 12qws
                    [lead_time] => 1 day
                    [transit_time] => 7 days
                )

            [1] => Array
                (
                    [SKU] => GM24EL
                    [brand_text] => Replacement
                    [shipping_date] => 2018-04-30
                    [source_zipcode] => 92641
                    [vendor_name] => USAP VA
                    [GUID] => 12qws
                    [lead_time] => 1 day
                    [transit_time] => 7 days
                )

        )

)
<br>{"items":[{"SKU":"GM24ER","brand_text":"Replacement","shipping_date":"2018-04-30","source_zipcode":92641,"vendor_name":"USAP LSL","GUID":"12qws","lead_time":"1 day","transit_time":"7 days"},{"SKU":"GM24EL","brand_text":"Replacement","shipping_date":"2018-04-30","source_zipcode":92641,"vendor_name":"USAP VA","GUID":"12qws","lead_time":"1 day","transit_time":"7 days"}]}


Create a new paste based on this one


Comments: