I have an array where I want to fetch a specific value ('created') and store then im a $_SESSION in a new array. How can I achieve that?
my array looks like this
Array
(
[0] => Array
(
[product_id] => 679
[quantity] => 1
[created] => 2018-10-01
)
[1] => Array
(
[product_id] => 677
[quantity] => 1
[created] => 2018-10-05
)
[2] => Array
(
[product_id] => 678
[quantity] => 1
[created] => 2018-10-03
)
)
I tried something like:
foreach($created as $i) {
$values = [$i]['created'];
echo $values;
}
session_start();
$_SESSION['creation_dates'] = $values;
but that doesn't work.
Can someone help me out?