|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[1999-12-19 14:53 UTC] leon at leonatkinson dot com
This code:
<HTML>
<HEAD>
<TITLE>str_repeat</TITLE>
</HEAD>
<BODY>
<?
print(str_repeat("PHP!<BR>\n", 10));
?>
</BODY>
</HTML>
produces this:
<HTML>
<HEAD>
<TITLE>str_repeat</TITLE>
</HEAD>
<BODY>
PHP!<BR>
PHP!<BR>
PHP!<BR>
PHP!<BR>
PHP!<BR>
PHP!<BR>
PHP!<BR>
PHP!<BR>
PHP!<BR>
PHP!<BR>
</BODY>
</HTML>
Note the extra space just before the closing body tag.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 28 08:00:01 2025 UTC |
echo strlen(str_repeat("a",3)); will output "4" on php4.0 beta 3, which proves that str_repeat deliberately adds one character to the end of the string. when tested with a later version (php 4.0.5) this error did not occur anymore.