Add spaces to a string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux