Most people dread connecting flights. But with a little planning, they can be turned into a vacation within a vacation.

That’s how I treated a recent stopover in Dubai, home to one of the busiest airports in the world — and some of the most fantastical human-made creations on the planet.

Emirates airline’s Dubai Connect program offers a hotel room and meals to passengers whose connections are between eight and 24 hours long, providing an easy (and free) way to incorporate this sliver of the United Arab Emirates into your trip. (Be sure to check the program’s stipulations; if a better connection is available, expenses might not be covered. Get the details at emirates.com.)

Our 20 hours in Dubai wasn’t nearly enough time to take it all in, but it was long enough to at least sample the city — and stretch our legs en route to Thailand.

7 p.m. Approaching Dubai from the sky shines a spotlight on the world’s tallest building, the Burj Khalifa, whose steel silkily spirals up toward the clouds. We landed in the early evening and headed straight for this iconic skyscraper that anchors an enormous mall and the 24-acre Burj Lake. There, the Dubai Fountain show — choreographed by the same designers as that of the Bellagio fountains in Las Vegas — takes place nightly, every 30 minutes. Plenty of restaurants are dotted around the fountain; meander as long as jet lag allows.

8 a.m. Begin the day where you left off at the 160-story Burj Khalifa, where tickets to the 124th floor observation deck start at around $35. It’s a good idea to buy a timed-entry ticket in advance (burjkhalifa.ae). If you’re crunched for time but not for cash, spring for the roughly $82 fast-track ticket to skip the lines. Floor-to-ceiling windows provide a 360-degree view of the city, where buildings that look enormous from a cab seem middling from this lofty vantage point. Be sure to peer through the special telescopes that give you a glimpse of what the area looked like years ago.

10 a.m. Depending on how long your visit to the Burj Khalifa takes, consider browsing the Souk Madinat Jumeirah’s rows of lamps, handmade pottery and, yes, touristy-type trinkets. It’s a convenient spot to pick up souvenirs and a beautiful box of baklava.

advertisement | advertise on newsday

Noon. The sail-shaped Burj Al Arab, a high-end hotel complex that includes nine bars and restaurants, is a Dubai landmark. If having a meal here is on your bucket list, don’t count on just strolling in without a reservation. After we asked a confused cabbie to take us there, security unceremoniously turned us away. Oh, well. It gave us extra time to explore.

1 p.m. A short walk from the Burj Al Arab takes you to a public beach, where we found a hip, yellow cart selling iced coffee. On a blazing hot day, that beverage felt just as luxurious as a fancy meal. A sandy stroll showcased the spectrum of beachwear in Dubai, which ranged from burqas to the occasional swimsuit. From here, cabs are easy to hail for a ride back to your hotel, where a shuttle will whisk you to the airport.

Emirates put us up in the Copthorne Hotel Dubai, which is also where delayed passengers can end up spending the night when the airline cancels an international flight and bungles the rebooking — as this reporter learned the hard way on the return leg. That’s the downside of connecting flights.