Sublime Forum

PHP syntax highlighting error

#1

Hi,
i’m using the latest version of SublimeText2. I’ve found this error:

<?php echo "UPDATE /data/*.png string blabla
"; ?>

The syntax highlighter highlight all the characters after /* as a comment. The problem exists only with UPDATE, this example work:

<?php echo "blabla /data/*.png string blabla
"; ?>

Bye,
smaffer

0 Likes

#2

The word UPDATE is causing the string to be parsed as a SQL statement. You could escape the asterisk:

<?php echo "UPDATE /data/\*.png string blabla<br>"; ?>
but it would still be parsed as SQL. Alternatively, you might try splitting it:

<?php echo "UPDATE " . "/data/*.png string blabla<br>"; ?>
or even (if necessary!):

<?php echo "UP" . "DATE " . "/data/*.png string blabla<br>"; ?>

0 Likes