Login   Register  
PHP Classes
elePHPant
Icontem

Array to Object converter: Turn any array into an object

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (5)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2009-05-03 (5 years ago) RSS 2.0 feedStarStar 33%Total: 1,178 All time: 2,953 This week: 1,463Up
Version License PHP version Categories  
toobj 1.0.4GNU General Public Lice...5.0PHP 5, Data types
Description Author  

This class can be used to turn any array into an object.

It takes an array and assigns the variables of the class with the values of the array entries with the same name.

Array entries with array values are also converted to objects recursively.

Innovation Award  
PHP Programming Innovation award nominee
April 2009
Number 2


Prize: One copy of VS.PHP
Since PHP 5, classes can be used to access objects as if they were arrays.

This class takes advantage of that possibility to quickly initialize object variables from data taken from associative arrays.

Manuel Lemos
Picture of Sebastian Potasiak
Name: Sebastian Potasiak <contact>
Classes: 8 packages by
Country: Poland Poland
Age: 21
All time rank: 62417 in Poland Poland
Week rank: 787 Down23 in Poland Poland Down
Innovation award
Innovation award
Nominee: 3x

  Files folder image Files  
File Role Description
Plain text file toobj.php Class Class file
Accessible without login Plain text file example.php Example Example of using class

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,178All time:2,953
 This week:0This week:1,463Up
User Ratings User Comments (1)  
 All time
Utility:35%StarStar
Consistency:85%StarStarStarStarStar
Documentation:-
Examples:70%StarStarStarStar
Tests:-
Videos:-
Overall:33%StarStar
Rank:2296
 
This class is pretty useless.
5 years ago (iltar van der berg)
17%Star