Hello,
Whats the best way to insert a new element into a array? Can we use the hash function for that?
Example:
I have this array bellow and want to insert ID 4 into Product:
array(
'Cart' => array(
'id' => '1',
'frete' => '15.00'
),
'Product' => array(
'Product' => array(
(int) 0 => '1',
(int) 1 => '2',
(int) 2 => '3'
)
)
)
Final result would be:
array(
'Cart' => array(
'id' => '1',
'frete' => '15.00'
),
'Product' => array(
'Product' => array(
(int) 0 => '1',
(int) 1 => '2',
(int) 2 => '3'
(int) 3 => '4'
)
)
)