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 <?= hello("World") ?>.</p>
11
<script>
12
    alert("And here is some JS code"); // also colored
13
</script>
14

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).