note 71303 added to function.str-repeat
| From: | nobodybutme at osu1 dot php dot net | Date: | Tue, 21 Nov 2006 19:32:52 +0000 |
| Subject: | note 71303 added to function.str-repeat | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119957@lists.php.net to get a copy of this message | ||
For anybody with older versions of PHP that do not support str_repeat(), here is a simple
alternative:
<?php
if(!function_exists("str_repeat")) {
function str_repeat($word, $length) {
$repeated = "";
for($i=0; $i < $length; $i++) {
$repeated .= $word;
}
return $repeated;
}
}
?>
----
Server IP: 64.71.164.2
Probable Submitter: 68.54.85.50
----
Manual Page -- http://www.php.net/manual/en/function.str-repeat.php
Edit -- https://master.php.net/note/edit/71303
Del: integrated -- https://master.php.net/note/delete/71303/integrated
Del: useless -- https://master.php.net/note/delete/71303/useless
Del: bad code -- https://master.php.net/note/delete/71303/bad+code
Del: spam -- https://master.php.net/note/delete/71303/spam
Del: non-english -- https://master.php.net/note/delete/71303/non-english
Del: in docs -- https://master.php.net/note/delete/71303/in+docs
Del: other reasons-- https://master.php.net/note/delete/71303
Reject -- https://master.php.net/note/reject/71303
Search -- https://master.php.net/manage/user-notes.php