Most of your examples can be written using simple php-style for strings. This isn't possible in PERL, but in PHP thats easy.
WHERE a='1' ";
is better readable in my opinion and don't introduce the <<< Statement which can be confusing to newbies.
Also you started with separation of code and presentation, but mix them in one file, its better to have seperate files, and next would be to use a simple Template system, there are lots available for PHP. Because only then you are save that the designer does not 'break' your code.