Tips for using the Netbeans editor for Kohana and Kostache / Mustache templates using `surround with`

A nice feature of NetBeans is the support for `code templates`: abbreviations that expand into snippets of code when the TAB key is pressed after typing the a shortcut in the editor. You can type fn TAB and have it expand to function blabla () { } That’s very convenient for long and often needed… Continue reading Tips for using the Netbeans editor for Kohana and Kostache / Mustache templates using `surround with`

Published
Categorized as PHP Tagged

Suppressing errors in PHP with control operator @

Errors give valuable information, it’s worth paying attention to. Sometimes though when parsing content from different sources you can run into errors you can prevent, or you can’t solve. Reading something into simpleXML that isn’t 100% validated XML, because it’s encoded in ISO-8859 instead of UTF-8. Then use the PHP one error control operator¬†@. When… Continue reading Suppressing errors in PHP with control operator @

Creating csv content

It is tempting to simply generate CSV data with writing comma-separated ¬†array-values. implode(",", $data_array); Unfortunately this obvious way of doing turns out to be a bad idea. Often it seems to be working at first, but eventually you’ll be faced with annoying bugs, wrongly escaped data. Fortunately, PHP has a native function to write CSV… Continue reading Creating csv content