library dot-notation-php
Access array data with dot notation
adrian-ortega/dot-notation-php
Access array data with dot notation
- Sunday, February 25, 2018
- by adrian-ortega
- Repository
- 1 Watchers
- 0 Stars
- 17 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
Simple Dot Notation with PHP
Access array data with dot notation., (*1)
Usage
$data = [
'first_name' => 'John',
'title' => 'Doe',
'company' => 'ACME',
'age' => 36,
'address' => [
'street' => '123 Anywhere Street',
'city' => 'Los Angeles',
'state' => 'CA',
'zip_code' => 90210
]
];
$street = DotNotation::parse('address.street', $data);
// outputs 123 Anywhere Street
echo $street