Bruno B B Magalhães wrote:
$code = 'function what() { do oddname; %oddsyntax }';

function highlight_code($code)
{
$oddsyntax = array('oddsyntax','oddsyntax2','oddsyntax3');
for($i = 0; $i <= count($oddsyntax)-1; $i++)
{
$highlighted_code = eregi_replace($oddsyntax[$i],'<spam class="highlighted">'.$oddsyntax[$i].'</spam>',$code);
}
return $code;
}

Hi Bruno...

I tried your sample, but it doesn't seem to work. I do however see what you're getting at.

Perhaps I need to experiment with the eregi_replace commands (or other regex commands) a bit.

Thanks,
--
Aaron Gould
Parts Canada - Web Developer

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to