Reply to Re: string concat vs. join/implode

Your name:

Reply:


Posted by NoWhereMan on 05/15/07 15:25

On 15 May 2007 07:25:57 -0700, ZeldorBlat wrote:

> If you post the code for the two functions you want me to compare I'll
> be happy to do so and post the results.

maybe something along these lines ? I'm not sure how much str_pad should
count but it should take about the same amount of time for both the
functions

-------------------------

function foo($count, $pad) {

$str = '';

for($i=0; $i<$count; $i++)
$str .= str_pad($i, $pad , "___");

return $str;

}

function bar($count, $pad) {

$str = array();

for($i=0; $i<$count; $i++)
$str[]= str_pad($i, $pad , "___");

return implode('', $str);
}
-------------------------

using large $count and $pad

dunno if this is test is valuable... it's the first thing I thought to
generate big different strings, without using a constant and without
randomizing

bye


--
NoWhereMan (e.v.)
-- http://www.nowhereland.it
-- http://flatpress.nowhereland.it

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация