/**
* 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));