Re: function to complete strings with white spaces on the left
| From: | Tolga \"thorr\" Orhon | Date: | Mon, 21 May 2001 15:04:21 +0000 |
| Subject: | Re: function to complete strings with white spaces on the left | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-53733@lists.php.net to get a copy of this message | ||
One improvment:
$strpad = "HELLO";
echo str_pad(substr($strpad,0,17),17);
may be more generic and secure...
--
Tolga 'thorr' Orhon
"Mark Maggelet" <maggelet@mminternet.com> wrote in message
news:200105210138.f4L1ceE10535@zeus.mminternet.com...
On Sun, 20 May 2001 22:03:05 -0300, Carlos Fernando Scheidecker
Antunes (nando@antunes.eti.br) 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: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net