2017 © Pedro Peláez
 

library arraytopathnamedobject

Converts an array to a path-named object

image

andrewhathaway/arraytopathnamedobject

Converts an array to a path-named object

  • Monday, November 18, 2013
  • by AndrewHathaway
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

ArrayToPathNamedObject

Converts arrays to objects, but concatenates paths with "_" instead of having object->object. Terrible project to name. Written originally for a friend who didn't want $obj->person->follower->photo. An exception will be thrown if conflicting keys are the conflicting., (*1)

For example:

When we have $data['person']['follower']['photo'] we can access it like $obj->person_follower_photo. You can also pass JSON string in and it will return the object., (*2)

Usage:

  • Can be installed via Composer.

```PHP require('ArrayToPathNamedObject.php');, (*3)

try { $obj = new ArrayToPathNamedObject($json); } catch(Exception $e) { die($e); }, (*4)

````, (*5)

@andrewhathaway, (*6)

The Versions

18/11 2013

dev-master

9999999-dev http://github.com/andrewhathaway/ArrayToPathNamedObject

Converts an array to a path-named object

  Sources   Download

MIT

array object convert path named

18/11 2013

v1.01

1.01.0.0 http://github.com/andrewhathaway/ArrayToPathNamedObject

Converts an array to a path-named object

  Sources   Download

MIT

array object convert path named

17/11 2013

v1.00

1.00.0.0 http://github.com/andrewhathaway/ArrayToPathNamedObject

Converts an array to a path-named object

  Sources   Download

MIT

array object convert path named