since the default pad_type is STR_PAD_RIGHT. using STR_PAD_BOTH were always favor in the right pad if the required number of padding characters can't be evenly divided. e.g<?phpecho str_pad("input", 10, "pp", STR_PAD_BOTH ); // ppinputpppecho str_pad("input", 6, "p", STR_PAD_BOTH ); // inputpecho str_pad("input", 8, "p", STR_PAD_BOTH ); //pinputpp?>