function display_rooms($results) { echo <<<EOS <div class="row"> <table class="table table-striped table-bordered"> <thead> <tr> <th>Room Number</th> <th>Room Type</th> <th>Beds</th> <th>Rate</th> <th>Cleaned</th> <th>Number of Guests</th> <th>Available</th> <th>Action</th> </tr> </thead> <tbody> EOS; if (is_array($results)) { for ($i = 0; $i < count($results); $i++) { display_room($results[$i]); } } else { display_room($results); } echo <<<EOS </tbody> </table> </div> EOS; }
function display_rooms($results) { if (is_array($results)) { for ($i = 0; $i < count($results); $i++) { display_room($results[$i]); } } else { display_room($results); } }