function replace($str){ static $color=0; $color+=50; return .$str.;}if( @ereg($match,$str,$array) ) { if(count($array)>1) { $string=$str; $pos=strpos($string,$array[1]); $string=substr_replace($string,replace($array[1]),$pos,strlen($array[1])); $pos=$pos+strlen(replace($array[1])); echo $string.'
'; for($i=2;$i1) print_r($array); }