note 28928 deleted from function.strlen by dave
| From: | dave@php.net | Date: | Fri, 05 May 2006 03:35:38 +0000 |
| Subject: | note 28928 deleted from function.strlen by dave | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-110606@lists.php.net to get a copy of this message | ||
Note Submitter: alber at netdot dot ch
----
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