⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shared.make_timestamp.php

📁 本网上购物系统就是为了建立与用户交流的平台,为了满足客户在线购物价格低廉物美的渴望,并基于互联网、以交易双方为主体、以银行电子支付和结算为手段、以客户数据为依托的全新的商务模式经营模式来开发的。它采用
💻 PHP
字号:
<?php/** * Smarty shared plugin * @package Smarty * @subpackage plugins *//** * Function: smarty_make_timestamp<br> * Purpose:  used by other smarty functions to make a timestamp *           from a string. * @author   Monte Ohrt <monte at ohrt dot com> * @param string * @return string */function smarty_make_timestamp($string){    if (empty($string))    {        // use "now":        $time = time();    }    elseif (is_numeric($string))    {        // it is a numeric string, we handle it as timestamp        $time = (int)$string;    }    elseif (preg_match('/^\d{14}$/', $string))    {        // it is mysql timestamp format of YYYYMMDDHHMMSS?        $time = mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2),                       substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4));    }    else    {        // strtotime should handle it        $time = strtotime($string);        if ($time == -1 || $time === false)        {            // strtotime() was not able to parse $string, use "now":            $time = time();        }    }    return $time;}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -