Просмотр поста

.
Folour
Think different

Saniok, Вот что пришло в голову гг

function codeAndSmiles($string) {
preg_match_all('~(.*?)\[php\](.*?)\[/php\](.*?)~s', $string, $match);
if(!empty($match[2])) {
$return = '';
foreach($match[1] as $key => $val)
$return .= (!empty($val) ? smileys($val) : '') . highlight($match[2][$key]) . (!empty($match[3][$key]) ? smileys($match[3][$key]) : '');

}
else {
$return = smileys($string);
}
return $return;
}


пробуй