I have this situation, I am applying the function
to fill a text string with spaces, but the problem is when the string contains accents (accents or ñ), since it tells me that character as if they were two, which causes the string to be filled with a minus character . Example
$texto="niña"; echo str_pad($texto,7,"-");
I do not know if there is an easy way to fix this, or you have to do it manually.