On Mon, May 21, 2001 at 10:04:21AM -0500, Tolga thorr Orhon wrote :
> One improvment:
>
> $strpad = "HELLO";
> echo str_pad(substr($strpad,0,17),17);
why ?
- Markus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [E
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
A
untested!
The reason for the if statement is that str_repeat will produce an error if
17-strlen($word) <= 0 and that'll break your scriptof course you could
remove the if state if you're positive the # of characters in $word never
exceeds 16.
Sincerely,
Craig Vincent
--
PHP General Mai
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
4 matches
Mail list logo