final public function arrayKeysToSnake(array $camelArray)
    {
        // hold the array of new values
        $snakeArray = [];
        foreach ($camelArray as $key => $value) {
            // tricky recursive
            if (is_array($value)) {
                $value = $this->arrayKeysToSnake($value);
            }

            $snakeArray[$this->underscore($key)] = $value;
            unset($camelArray[$key]);
        }
        return $snakeArray;
    }
final public function arrayKeysToSnake(array $camelArray)
    {
        // hold the array of new values
        $snakeArray = [];
        foreach ($camelArray as $key => $value) {
            // tricky recursive
            if (is_array($value)) {
                $value = $this->arrayKeysToSnake($value);
            }

            $snakeArray[$this->underscore($key)] = $value;
            unset($camelArray[$key]);
        }
        return $snakeArray;
    }
final public function arrayKeysToSnake ( array $ camelArray ) { // hold the array of new values $ snakeArray = [ ] ; foreach ( $ camelArray as $ key => $ value ) { // tricky recursive if ( is_array ( $ value ) ) { $ value = $ this -> arrayKeysToSnake ( $ value ) ; } $ snakeArray [ $ this -> underscore ( $ key ) ] = $ value ; unset ( $ camelArray [ $ key ] ) ; } return $ snakeArray ; }
In-Place, recursive conversion of array keys in camelCase to snake_Case

@param array $camelArray
@return array
In - Place recursive conversion of array keys in camelCase to snake_Case