7
votes

Do you guys know a syntax highlighter capable of highlighting mixed PHP+HTML+CSS+JS code?

like:

<?php
 echo 'foo';
?>
<div> foo </div>
<style type="text/css">
  .foo {color: #3d3;}
</style>

I only know GeShi so far. It's pretty cool, but it only supports one language at a time.

1
Are you looking for an IDE or you want to highlight code in a web page you are rendering?Darin Dimitrov
in a web site, highlight before outputAlex
@Alexndra, great, thanks for the clarification. I guess I didn't read your question carefully.Darin Dimitrov
i know this doesn't do fully what you want, but there is something to be said for the php highlight_string() function.dqhendricks
also, most people use client side javascript solutions for this, because highlighting string during output each time a page is requested is very taxing on a server, and highlighting on input makes future editing a pain.dqhendricks

1 Answers

8
votes

It's not PHP, but Pygments is awesome. And it is faster than GeShi, even used in PHP with the system()function.