> Yes, but my example was geared towards trying to work through a more
> generic scenario. I'll bet if you try using perl regex with callback
> it'll be even faster.
I'll take that bet and say using preg_*_callback will be slower. :) I'll try
and time each of them tonite and post what I find.
Som
Yes, but my example was geared towards trying to work through a more
generic scenario. I'll bet if you try using perl regex with callback
it'll be even faster.
Marco
--
php|architect - The magazine for PHP Professionals
The monthly worldwide magazine dedicated to PHP programmers
Co
Hi!
I have dome almost the same
$input = 'Today is a very beautiful day and the sun is shining';
$output = array();
$words = explode(' ',$input);
$cur_pos = 0;
foreach($words as $word) {
if(!empty($output[$word])){
$output[$word] .= ','.$cur_pos;
} else {
$output[$word]
3 matches
Mail list logo