Forums / National / Russian / Тех. поддержка / Сайт лежит

Kabak
#46898 2023-06-12 09:59
if (!function_exists('strptime'))
{
    /**
     * strptime() for Windows
     * @author ex/yks toolkit
     * @license MIT
     * @param string $date
     * @param string $format
     * @return boolean
     *
     * @deprecated This function has been DEPRECATED as of PHP 8.1.0. Relying on this function is highly discouraged.
     */
	function strptime($date, $format)
	{
		$masks = array(
			'%d' => '(?P<d>[0-9]{2})',
			'%m' => '(?P<m>[0-9]{2})',
			'%Y' => '(?P<Y>[0-9]{4})',
			'%H' => '(?P<H>[0-9]{2})',
			'%M' => '(?P<M>[0-9]{2})',
			'%S' => '(?P<S>[0-9]{2})'
		);

		$rexep = "#" . strtr(preg_quote($format), $masks) . "#";
		if (!preg_match($rexep, $date, $out))
			return false;

		$ret = array(
			"tm_sec" => (int) $out['S'],
			"tm_min" => (int) $out['M'],
			"tm_hour" => (int) $out['H'],
			"tm_mday" => (int) $out['d'],
			"tm_mon" => $out['m'] ? $out['m'] - 1 : 0,
			"tm_year" => $out['Y'] > 1900 ? $out['Y'] - 1900 : 0,
		);
		return $ret;
	}
}

можете пояснить про этот код в functions.php ?

он в какой функции или он всегда отрабатывает ?