Archive

- for May, 2012

Array Join instead of String concat in Loop in JavaScript!

You may have seen array join after pushing data inside Array for concatenation work in JavaScript. That was faster method compared to doing large number of string concatenation in older Browser. Browser used to crash in such large number of concatenation. So, Array Join was the workaround. Now, change your… (Continue)

stdClass Object to Array in PHP

If you deal with Restful services then many times you need to deal with stdClass Object. This generally create requirements to stdClass Object to Array conversion.
Here is the code to do that in Class:

<?php

function objectToArray($o) {
if (is_object($o)) {
$o = get_object_vars($o);
}

if (is_array($o)) {

return… (Continue)