Categories
PHP Programming

Convert XML to array and vice versa in PHP

As a developer, it is common to search the web for an existing (open source) code snippet to re-use for an application, but it is rare for the developer to just copy code online and use it straight in their application without modifying it first.

I am one of many developers who like to save time if possible by using open source code if coding from scratch takes longer than a couple of minutes, but there are times when one cannot be found. I ran into such situation when I wanted a function that converts an XML string into an array. Unfortunately, most are overly complicated for what I wanted, so I decided to create my own and share with the world. The following function converts XML strings into a PHP array while retaining the level depths of the XML but all attributes are ignored.

Categories
js PHP Programming

php.js

If you are a PHP programmer struggling with javascript, then php.js is your answer.

Categories
PHP Programming

PHP MVC framework war

Back when CakePHP’s v1.2 was still in its beta stage, I started learning the PHP language using the MVC (model-view-controller) framework, and I grew to love the language. I became more fluent with the language as I grew more biased towards cake. I would often google MVC comparisons like “CakePHP vs codeigniter“, or “CakePHP vs symfony“, etc, but in my heart, I knew CakePHP was the one for me.