How is it possible to perform a foreach function without doing a loop for example
foreach($result['orders'] as $order) {
But I don’t want to do a foreach I want something like
$result['orders'] == $order;
Or something like that instead of doing it inside an loop because $result['orders'] is only returning 1 result anyway so I don’t see the point in doing it in a loop.
Thank you
You can get the first (and apparently only) element in the array with any array function that gets an element from the array, e.g.
array_pop()orarray_shift():Or
list():Or, if you know it’s numerically indexed, access it directly: