Created
January 5, 2020 15:21
-
-
Save tlkshadow/1e8ef15d5bc18ba146aafb1f169771d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$aCity = new \stdClass(); | |
$aCity->name = 'Hamburg'; | |
$object = new \stdClass(); | |
$object->name = 'Marcel'; | |
$object->cities = [$aCity]; | |
echo data_get($object, 'name'); | |
echo data_get($object, 'not', ' is from '); | |
echo data_get($object, 'cities.0.name'); | |
## Output: Marcel is from Hamburg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment