A planter box for holding planting soil includes a box body having a bottom wall, a sidewall and an open top. An anti-clog drainage and irrigation pipe is mounted across and above the bottom wall. The pipe includes a water inflow and outflow opening formed at a lower portion and extending along the length of the pipe. Two flow-guiding plates extend from two longitudinal sides of the water inflow and outflow opening towards an interior of the pipe body to form two overflow troughs in the pipe. During rainy day, the pipe is used for drainage. During sunny days, water can be supplied to the pipe for irrigation. A method for soil drainage and irrigation is also disclosed.