php 获取数组深度的值

匿名函数(闭包)

    $val = array();
    array_walk_recursive($array, function ($x) use (&$val) {
        $val[] = $x;
    });
    return $val;

  

原文地址:https://www.cnblogs.com/cbugs/p/10609747.html