Here is a simple function to check an array to see if it contains all null values. function allNulls($arr) { if(is_array($arr) && count(array_diff($arr, array(null))) == 0) { return true; } return false; } echo (allNulls(array(null,null,null)) ? "true" : "false") . PHP_EOL; echo (allNulls(array(null,1,null)) ? "true" : "false") . PHP_EOL; echo […]
php
While developing apps that use external web services, a proxy often comes in handy in order to bypass the pesky XSS security settings found in most browsers. Here is a simple PHP proxy I’ve found quite helpful.
Simple PHP Proxy
I ran into a situation recently where I had a very large array object that was not going to change. It was the polygon coordinates for the world countries to be used in KML provided by Thematic Mapping. I didn’t wan’t to pull this data out of MySQL every time […]
Using PHP to write PHP
Earlier this year Facebook developers caused quite a stir in the PHP community by releasing HipHop, the central piece in their high-performance arsenal. Here is the video of the initial announcement along with some juicy technical details: If you are interested in seeing how your PHP project fares when run […]
HipHop for PHP
A demo of SOAPjr using PHP/Symfony and ExtJS is now available at http://dev.communitybookshelf.org/ This demo showcases these custom components: Backend: pSOAPjr sfSOAPjrActionPlugin Frontend eSOAPjr Questions/comments? We’d love to hear from you!
SOAPjr Demo
Many might consider even the thought of running PHP inside of a Java Virtual Machine to be anathema. Others will wonder why bother (apart from the novelty). However running PHP in Java has one crucal benefit: it future-proofs your code. Quercus is a nifty utility that will allow you to run […]
Running PHP in Java
I wrote this method the other day that takes a simple PHP object, inspects it’s properties and “prunes” empty ones. I wrote this method in order to compress JSON objects by removing null properties before sending them down the wire, a big problem when using base objects or models. If […]