PHP Object to Multidimensional Array

Below is a piece of code showing how to transform an Object into a Multidimensional Array, there are quite a few functions in PHP that return stdClass objects such as some MySQL, JSON or XML functions. If it is a one dimensional array, you’ll probably typecast it (array)$data; to get the result you want – But if the Object has multiple dimensions to it and you typecast it you’ll get a mixture of Array with elements that contain Objects.

Read More

PHP Simple permission framework with Bitwise operations

Below is an example class of a basic permission framework with permissions worked out by using bitwise operations. This provides basic functions such as hasAccess() can() and permNeeded()

I won’t be going into detail regarding binary math and why it works as it does, as there are many other sites out there explaining this in great detail. This is just an example code post.

Read More

WordPress 3.3 Beta 1 released

Straight in from the WordPress.org website…

“WordPress 3.3 is ready for beta testers.

As always, this is software still in development and we don’t recommend that you run it on a production site — set up a test site just to play with the new version. If you break it (find a bug), please report it, and if you’re a developer, try to help us fix it.

Read More

Turn PHP classes in to a RESTful API with Restler

The Restler packer is a RESTful API server framework that is written in PHP that aids your mobile / web / desktop applications. A framework, but with a difference – Restler is all here to bend and mend to your needs. While designing your application, RESTful server makes use of the Web’s well known architecture to your benefit, you will just need to simply declare the function as protected and add an authentication class.

Read More