hyperf / hyperf/collection

data_get的key麻烦强制转换下为字符串,比如__toString()这样的特性就可以用到了

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

```
/**
* Get an item from an array or object using "dot" notation.
*
* @param mixed $target
* @param null|array|int|string $key
* @param mixed $default
* @return mixed
*/
function data_get($target, $key, $default = null)
{
if (is_null($key)) {
return $target;
}

$key = is_array($key) ? $key : explode('.', strval($key));

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.