note 28928 added to function.strlen
| From: | alber at netdot dot ch | Date: | Tue, 28 Jan 2003 11:26:38 +0000 |
| Subject: | note 28928 added to function.strlen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-42918@lists.php.net to get a copy of this message | ||
If you are using php < 4.01 this function makes the same as
str_pad in php >=4.01
function str_pad($variable, $size)
{
while (strlen($variable) < $size)
{
$variable = $variable ." "; //Add Space
}//End While
return $variable;
}//End Function
ex.
$NameVorname = "AlberMichael";
$name=substr(str_pad($NameVorname,20),0,20);
$pdf=str_replace("NameVorname",$name,$pdf);
echo $pdf; //Returns AlberMichael
--
http://www.php.net/manual/en/function.strlen.php
http://master.php.net/manage/user-notes.php?action=edit+28928
http://master.php.net/manage/user-notes.php?action=delete+28928
http://master.php.net/manage/user-notes.php?action=reject+28928