One improvment:
$strpad = "HELLO";
echo str_pad(substr($strpad,0,17),17);
may be more generic and secure...
--
Tolga 'thorr' Orhon
"Mark Maggelet" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Sun, 20 May 2001 22:03:05 -0300, Carlos Fernando Scheidecker
Antunes ([EMAIL PROTECTED]) wrote:
>Hello All,
>
>I need to output a string that must always be 17 characters even if
>the inside value is not.
>
>Supose a have the HELLO word that is a 5 character string and I need
>to output "HELLO " which is 17 characters.
>How can I accomplish this in PHP4 ?
>
>Has anyone ever did it?
echo str_pad("HELLO",17);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]