protected static function filterStrings(array &$subjectArray, $goDeep = null, $filterFunction = null)
    {
        $arrayWalkFunction = self::getArrayWalkFunction($goDeep);

        $arrayWalkFunction($subjectArray, function (&$item) use ($filterFunction) {
            if (!is_string($item)) {
                return;
            }

            if (is_callable($filterFunction)) {
                $item = $filterFunction($item);
            }

            $item = trim($item);
        });

        return $subjectArray;
    }
protected static function filterStrings(array &$subjectArray, $goDeep = null, $filterFunction = null)
    {
        $arrayWalkFunction = self::getArrayWalkFunction($goDeep);

        $arrayWalkFunction($subjectArray, function (&$item) use ($filterFunction) {
            if (!is_string($item)) {
                return;
            }

            if (is_callable($filterFunction)) {
                $item = $filterFunction($item);
            }

            $item = trim($item);
        });

        return $subjectArray;
    }
protected static function filterStrings ( array & $ subjectArray , $ goDeep = null , $ filterFunction = null ) { $ arrayWalkFunction = self :: getArrayWalkFunction ( $ goDeep ) ; $ arrayWalkFunction ( $ subjectArray , function ( & $ item ) use ( $ filterFunction ) { if ( ! is_string ( $ item ) ) { return ; } if ( is_callable ( $ filterFunction ) ) { $ item = $ filterFunction ( $ item ) ; } $ item = trim ( $ item ) ; } ) ; return $ subjectArray ; }
Filter the strings within the given array. Strings will be trimmed with
an optional filter function to process too.

@since 3.0.0

@param array $subjectArray Array to work on.
@param bool|null $goDeep Walk deeply through each level when true.
@param callable|null $filterFunction

@return array
Filter the strings within the given array . Strings will be trimmed with an optional filter function to process too .