//点语法获取数组元素 private function getNestedVar(&$context, $name) { $pieces = explode('.', $name); foreach ($pieces as $piece) { if (!is_array($context) || !array_key_exists($piece, $context)) { // error occurred return null; } $context = &$context[$piece]; } return $context; }
php 点语法获取数组
最新推荐文章于 2023-02-26 16:45:47 发布