fork(1) download
  1. <?php
  2.  
  3. // your code goes here
  4.  
  5. function mb_str_pad($input, $pad_length, $pad_string = ' ', $pad_type = STR_PAD_RIGHT, $encoding = "UTF-8") {
  6. $diff = strlen($input) - mb_strlen($input, $encoding);
  7. return substr(str_pad($input, $pad_length + $diff, $pad_string, $pad_type),0,15);
  8. }
  9.  
  10. echo mb_str_pad("ESPERANÇAaaaaaaaaaaa", 15, "#");
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
ESPERANÇAaaaaa