How to add a specified number of spaces to a string  

I use this but won't work if  $spaces is less than the length of the $string 

$string = "bla bla bla";
$spaces = 5;
$string = str_pad($string, $spaces, " ");


Thanks in advance for your help

Reply via email to