Modes are selectively excited by launching light through the cladding from the side into a hollow-core photonic crystal fiber. Measuring the total output power at the end of the fiber as a function of the angle of incidence of the exciting laser beam provides a powerful diagnostic for characterizing the cladding bandgap. Furthermore, various types of modes on either side of the bandgap are excited individually, and their near-field images are obtained.