adrian-ortega / dot-notation-php
使用点符号访问数组数据
0.0.0
2018-02-25 22:30 UTC
This package is not auto-updated.
Last update: 2024-09-14 20:14:49 UTC
README
使用点符号访问数组数据。
用法
$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