function getTotalpage($total_items, $items_per_page) { $total_pages = ceil($total_items / $items_per_page); return $total_pages; }The code above uses the ceil function to round up the division result to the nearest integer, ensuring that there are no incomplete pages. The package library for this function would be the PHP standard library.