New PHP Highlighter In Town

Hey everyone,

As you could have read here, the current release of my code highlighter has some trouble with highlighting PHP on servers running PHP version 4. I told you I should try to fix the problem and include a better PHP highlighter in the next release.

I worked very hard this morning to get PHP fixed, and I’m proud to announce that PHP is almost working the way it should. That means: including servers running PHP4.

You want an example? Sure, here it is:

PHP Code Like It Should

<?php
/* Connect to a MySQL database using driver invocation */
$dsn = 'mysql:dbname=testdb;host=127.0.0.1';
$user = 'dbuser';
$password = 'dbpass';

try {
    $conn = new PDO($dsn, $user, $password);
    $sql = 'SELECT name, color, calories FROM fruit ORDER BY name';

    foreach ($conn->query($sql) as $row) {
        echo $row['name'] . "\t";
        echo $row['color'] . "\t";
        echo $row['calories'] . "\n";
    }
} catch (PDOException $e) {
    echo 'Connection failed: ' . $e->getMessage();
}
?>

So, What’s Next?

After this highlighter is finished, I create one for JavaScript and properly one for Java. As soon as they all work the way it should, I will release version 1.1.

See you.

PHP, Wordpress Plugins
,