Flatten array

public function array_flatten($a, $f = array()) {
    if (!$a || !is_array($a)) {
        return '';
    }
    if (is_array($a) && count($a)) {
        foreach ($a as $k => $v) {
            if (is_array($v)) {
                $f = mslib_befe::array_flatten($v, $f);
            } else {
                $f[$k] = $v;
            }
        }
    }
    return $f;
}
Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on whatsapp