Is there a way to refer to a value of an array inside of an aray?
For example.
I have the following php code to loop through an array listed below. Can I easily get the [product_name] => DIESEL #2 data without another for loop? If I know the data will always come this way? Something like $fuel = $value['transaction_id'.'product'.'product_name']?
foreach ($result['data'] as $key => $value) {
$id = $value['id'];
$transactionId = "FC".$value['transaction_id'];
$transactionDateTime = $value['created_utc'];
echo $id." - ".$transactionDateTime." - ".$transactionId." </br>";
}
(
[data] => Array
(
[0] => Array
(
[id] => 5750574
[label] =>
[self] => https://api.fuelcloud.com/rest/v1.0/transaction/5750574
[transaction_id] => 0025621e-3270-c0e2-8d2a-6425ed834f9d
[transaction_type] => 1
[tank_id] => 23744
[start_date] => 2019-12-19T00:00:00
[end_date] => 2019-12-19T23:59:59Z
[site_id] => 23743
[product_id] => 409
[product] => Array
(
[id] => 409
[product_name] => DIESEL #2
[product_category] => diesel
)