This study investigates graded porosity in nanowire arrays to realize a new graded refractive index mechanism that results in unprecedented broadband antireflection and extends the photodetection properties to cover the entire visible-light range. In this work, ZnO nanowires (NWs) are chosen as a model system to demonstrate the porosity-induced antireflection and photodetection properties for visible light. Porous ZnO NW arrays (PZNA) were synthesized by the hydrothermal method followed by controlled hydrogen annealing for different durations. The surface pores of the PZNA were formed with a gradient distribution from the top to the bottom of the nanowires. This pore gradient distribution serves as a new mechanism to achieve a graded refractive index, which provides improved broadband antireflection in PZNA with a minimum reflectance of less than 5% at 800 nm. Moreover, the cathodoluminescence spectra suggest the evolution of many defects in PZNA, which contribute to defect-state excitation phenomena. Based on their unique features with regard to antireflection, multiple scattering and defect state excitation, the PZNA devices exhibit an exceptional capability for steady photodetection over the entire visible-light range. The corresponding unique photodetection mechanisms for the phenomena are discussed. These new physical phenomena can be readily extended to other 1D materials and used to develop other optoelectronic devices.