PHP / JSON: how to know if JSON data is empty or not


Just a very simple mistake that I faced now. Currently, I create a table that shows data from the database (JSON). In that table, I want to verify if the data exists or not. Let's say that if the data is empty, I want to show "There is no reservation data available at this time".

The problem is that I don't know how to verify existing data. For now, if the data is empty, the table appears alone and without words "No reservation data is available at this time".

Below is my current code

  ";
    echo "
No booking data available at this moments"; }else{ echo "
"; echo "
"; echo "

All Booking

"; echo ""; echo ""; echo ""; echo ""; foreach ($json->bookingList as $row) { $status=$row->status; if($status=="Approve"){ $color="color:green"; }else if($status=="Pending"){ $color="color:blue"; }else{ $color="color:red"; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo ""; echo "
# Requester Factory Room Purpose Status Action
" . $row->bookNo. "" . $row->requestedBy. "" . $row->facID. "" . $row->roomName. "" . $row->desc. "" . $status .""; echo "View"; echo "

"; echo "
"; echo "
"; } ?>