<?php
$items = array(
array(
'id' => 314,
'name' => 'Product Example 1',
'sku' => '3324',
'price' => '3.25',
'avail' => 'Y'
),
array(
'id' => 315,
'name' => 'Product Example 2',
'sku' => '3327',
'price' => '2.99',
'avail' => 'N'
)
);
$arr = array();
foreach($items as $item){
$arr[] = $item;
}
echo "<pre>".print_r($arr)."</pre>";
?>
- Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.6 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
- Array
(
[0] => Array
(
[id] => 314
[name] => Product Example 1
[sku] => 3324
[price] => 3.25
[avail] => Y
)
[1] => Array
(
[id] => 315
[name] => Product Example 2
[sku] => 3327
[price] => 2.99
[avail] => N
)
)
<pre>1</pre>
preferences:
188.89 ms | 404 KiB | 208 Q