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