PHP mode

x
 
1
            <?php
2
$a = array('a' => 1, 'b' => 2, 3 => 'c');
3
4
echo "$a[a] ${a[3] /* } comment */} {$a[b]} \$a[a]";
5
6
function hello($who) {
7
    return "Hello $who!";
8
}
9
?>
10
                <p>The program says
11
                    <?= hello("World") ?>.</p>
12
                <script>
13
                    alert("And here is some JS code"); // also colored
14
                </script>
15
        

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

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