array_walk_recursive

Supported Versions: PHP 5, PHP 7, PHP 8
Apply a user function recursively to every member of an array
<?php array_walk_recursive(array|object &$array, callable $callback, mixed $arg = null): bool
<?php         if (is_string($line)) {

            return $this->makeReplacements($line, $replace);

        } elseif (is_array($line) && count($line) > 0) {

            array_walk_recursive($line, function (&$value, $key) use ($replace) {

                $value = $this->makeReplacements($value, $replace);

            });



            return $line;

        }