I want to highlight some words (ex. “true”, “false”), but only when they are between the tags <?= and ?>.
In the example below I only want to highlight the second “true” keyword:
<input checked="true"><?=($i === true ? $foo : $bar)?>
Is there any special font-locking mode for this kind of situation?
Font lock can call functions too in addition to matching regexps:
http://www.gnu.org/s/emacs/manual/html_node/elisp/Search_002dbased-Fontification.html
Only you need to know Elisp.