PHP Coding Tips

Friday, August 10, 2012

How to add element to an array ?

If you want how to add or append element to a PHP array, see this code snippet:$somethings = array(); $somethings[] = "element"; // append as last element $somethings[4] = "other element"; $somethings['thekey'] = "some other element";

No comments:

Post a Comment