PHP Classes

Array to Object converter: Turn any array into an object

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStar 33%Total: 1,221 All time: 3,123 This week: 455Up
Version License PHP version Categories
toobj 1.0.4GNU General Publi...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
  Performance   Level  
Name: Sebastian Potasiak <contact>
Classes: 8 packages by
Country: United States United States
Innovation award
Innovation award
Nominee: 3x

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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,221
This week:0
All time:3,123
This week:455Up
User Ratings User Comments (1)
 All time
Utility:37%StarStar
Consistency:79%StarStarStarStar
Documentation:-
Examples:66%StarStarStarStar
Tests:-
Videos:-
Overall:33%StarStar
Rank:4257
 
This class is pretty useless.
15 years ago (iltar van der berg)
17%Star