Created
July 2, 2012 15:46
-
-
Save DarkSmith/3033877 to your computer and use it in GitHub Desktop.
access to object with dot notation string
This file contains hidden or 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
$data = array('parent' => array('child' => 'hello world')); | |
$filter = new DotNotationFilter($data); // $data is an object or an array | |
$hello = $filter->get('parent.child'); // eq to $data['parent'][’child'] or $data->parent->child; | |
$hello == 'hello world'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment