Re: Syntax highlighting of odd language

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux