CodeMirror: PHP mode

1
2
3
4
5
6
7
8
9
10
 
<?php
function hello($who) {
    return "Hello " . $who;
}
?>
<p>The program says <?= hello("World") ?>.</p>
<script>
    alert("And here is some JS code"); // also colored
</script>
 

Simple HTML/PHP mode based on the C-like mode. Depends on XML, JavaScript, CSS, and C-like modes.

MIME types defined: application/x-httpd-php (HTML with PHP code), text/x-php (plain, non-wrapped PHP code).