i'm not very good in PHP but i'm learning as we go, i have a question for you as this is most likely very easy to do but i can't get my head around this and spent now many hours trying to solve this.
I'm working in a booking system, and the foreach loop showing a list of bookings and the booking details is on the same page, however the total price is just in the view of the booking list and not on the booking details. I'm trying to get the value of the total booking in a single line...
Like now it's
<?php if (isset($booking) && !empty($booking)) { ?>
<?php foreach ($booking as $key => $val) { ?>
...
<?= number_format($val->total_rental, 2, '.', ',') ?>
...
<?php } ?>
<?php } ?>
On the booking list, and i am trying to add this on the booking details page with single line something like.
<?= number_format($booking->total_rental, 2, '.', ',') ?>
But it never gives any value, do you have an idea of what i am doing wrong or am i missing something that i should search for in the code ?.
All php code that show any details on the booking details page are echo'd out like this.
<?= $detail['info']->id_booking ?>
So i even tried something like this.
<?= number_format($detail['info']->total_rental, 2, '.', ',') ?>
But still nothing.. etc.
Any help is greatly appreciated, i might be on the wrong path here...