#14523 [Opn->Asn]: Additional parameter for str_repeat

From: Date: Sat, 31 May 2003 16:25:42 +0000
Subject: #14523 [Opn->Asn]: Additional parameter for str_repeat
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-40789@lists.php.net to get a copy of this message
ID: 14523 Updated by: andrey@php.net Reported By: ahristov at icygen dot com -Status: Open +Status: Assigned Bug Type: Feature/Change Request PHP Version: 4.1.0 -Assigned To: +Assigned To: pollita New Comment: better will be done with : <?php $a = array("one", "two", "three"); $s = "[text]"; echo str_replace(array('text'), array_values($a), str_repeat($s, 10)); ?> but this doesn't work. So, reclassifying as feature request for str_replace(). "str_replace() should behave differently when string is used as [search] and array is passed as [replace]". Pollita, any comment on that. If that will break BC, then we will "won't fix" this. Thanks. Previous Comments: ------------------------------------------------------------------------ [2001-12-14 14:39:33] sander@php.net No need to close! Reopened, still a feature-request. ------------------------------------------------------------------------ [2001-12-14 14:14:36] ahristov at icygen dot com Is is possible third parameter to be added to str_repeat(). In case in the string there is a name of a variable and it is of type array the following code : foreach ($some_arr as $k =$v){ $output .= '<some_html>...'.$v.'....</some_html>'; } to be in one line $output = str_repeat('<some_html>...$some_arr ...</some_html>',count($some_arr),REPEAT_SUBSITUTE); Regards, Andrey Hristov ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=14523&edit=1

« previous php.bugs (#40789) next »