If you're like me, your iPhone has way too many Safari tabs open. Links from other applications open up new tabs automatically, it's too easy to open up new tabs to search, and sometimes you're skittish about closing pages you don't want to forget about. This all creates a massive mess that requires cleaning house, and there's an easy trick to doing just that.
While on the surface it appears you need to close out of each Safari tab manually, there's actually a quick way to close them all at once. If you really want to save some webpages first, go through and bookmark them or add them to your reading list so you don't lose them before using this trick for a clean slate.
Just like you normally would, tap the two-squares icon in the bottom menu (or top, if in landscape mode) to display all of your tabs. In this tabs overview, you can either tap the "X" or swipe left on any tab to promptly close it. If you have a ton of tabs to close, this could get tedious real fast.
A much faster way to close your tabs exists, without you needing to look at your tabs at all. Simply tap and hold the two-squares (tabs) icon in the bottom-right corner of Safari (or top-right, if in landscape view). Moments later, a menu appears with some helpful options. To close all open tabs at once, just tap "Close All [#] Tabs" (I had a whopping 211 open when writing this, as you can see).
That's not the only nifty function this menu has to offer. You can close the tab you are currently viewing by tapping "Close This Tab," and you can open a new or private tab by tapping "New Tab" and "New Private Tab," respectively. While the latter three options might not be as useful as the hidden "Close All [#] Tabs," they offer a way to skip a step to perform these actions.