note 113966 added to function.str-pad
| From: | MohammadNabil | Date: | Mon, 23 Dec 2013 09:16:09 +0000 |
| Subject: | note 113966 added to function.str-pad | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198008@lists.php.net to get a copy of this message | ||
To pad with complete HTML & or
function padString($string, $repetition, $count, $direction) {
$length = strlen($string);
for ($i = 0; $i < $count - $length; $i++) {
if ($direction == STR_PAD_LEFT) {
$string = $repetition . $string;
} else {//STR_PAD_RIGHT
$string = $string . $repetition;
}
}
return $string;
}
padString("Text", " ", 10, STR_PAD_LEFT)
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/function.str-pad.php
Edit -- https://master.php.net/note/edit/113966
Del: integrated -- https://master.php.net/note/delete/113966/integrated
Del: useless -- https://master.php.net/note/delete/113966/useless
Del: bad code -- https://master.php.net/note/delete/113966/bad+code
Del: spam -- https://master.php.net/note/delete/113966/spam
Del: non-english -- https://master.php.net/note/delete/113966/non-english
Del: in docs -- https://master.php.net/note/delete/113966/in+docs
Del: other reasons-- https://master.php.net/note/delete/113966
Reject -- https://master.php.net/note/reject/113966
Search -- https://master.php.net/manage/user-notes.php