Archive for August, 2009

Perl str_replace

Sunday, August 9th, 2009

$s =~ s!\Q$search!$replacement!g;

\Q will quote a string until \E (if \E is ommitted will quote the whole string). You need to quote the string because s/// uses regexp;

You can view more Perl written in PHP here.

Netbeans + CakePHP – syntax highlighting for .ctp files

Thursday, August 6th, 2009

Tools -> Options -> Miscellaneous -> Files

New File Extension (ctp)

Associate with PHP

Viola! CTP files are now treated as PHP files!