update page now

Voting

: eight minus zero?
(Example: nine)

The Note You're Voting On

mcinp
10 years ago
a different, more robust multibyte version of str_pad that works correctly only if $pad_string is non-multibyte string

function my_mb_str_pad($input, $pad_length, $pad_string=' ', $pad_type=STR_PAD_RIGHT,$encoding='UTF-8'){
    $mb_diff=mb_strlen($str, $encoding)-strlen($string);        
    return str_pad($input,$pad_length+$mb_diff,$pad_string,$pad_type);
}

<< Back to user notes page

To Top