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