keboola/php-utils

View on GitHub
src/Keboola/Utils/replaceDatesInArray.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Keboola\Utils;

/**
 * @param $array
 * @param string $tag
 * @param string $format
 * @param null $timezone
 * @return mixed
 */
function replaceDatesInArray($array, $tag = '%%', $format = DATE_W3C, $timezone = null)
{
    array_walk_recursive($array, function (&$string, $key, $settings) {
        $string = replaceDates($string, $settings['tag'], $settings['format'], $settings['timezone']);
    }, ['tag' => $tag, 'format' => $format, 'timezone' => $timezone]);
    return $array;
}