PHP Classes

PHP Array to Javascript: Convert PHP arrays into Javascript objects

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
StarStarStar 45%Total: 2,439 All time: 1,592 This week: 560Up
Version License Categories
array_to_js 1.0.0GNU General Publi...Data types
Description 

Author

This class can be used to convert PHP associative arrays to Javascript objects that have properties set with the PHP array entries.

It traverses the entries of one or more associative arrays recursively and generates code that define Javascript objects.

The names of the object properties are the keys of the array entries. The property values are set to the respective array values.

Picture of Jan Paepke
Name: Jan Paepke <contact>
Classes: 2 packages by
Country: Germany Germany
Age: 42
All time rank: 91957 in Germany Germany
Week rank: 164 Up8 in Germany Germany Up

  Files folder image Files (2)  
File Role Description
Accessible without login Plain text file class_arraytojs.php Class Main Class File
Plain text file example.php Example example / documentation

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:2,439
This week:0
All time:1,592
This week:560Up
 User Ratings  
 
 All time
Utility:62%StarStarStarStar
Consistency:65%StarStarStarStar
Documentation:-
Examples:72%StarStarStarStar
Tests:-
Videos:-
Overall:45%StarStarStar
Rank:3347