本文整理汇总了PHP中TimeDate::elapsed方法的典型用法代码示例。如果您正苦于以下问题:PHP TimeDate::elapsed方法的具体用法?PHP TimeDate::elapsed怎么用?PHP TimeDate::elapsed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeDate
的用法示例。
在下文中一共展示了TimeDate::elapsed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logic
//.........这里部分代码省略.........
case "dmydate":
$return = date("d/m/Y", strtotime($object));
break;
case "hmdate":
$return = date("H:i", strtotime($object));
break;
case "month":
$return = date("m", strtotime($object));
break;
case "fullmonth":
$return = date("F", strtotime($object));
break;
case "year":
$return = date("Y", strtotime($object));
break;
case "age":
//$return = abs(mktime(0,0,0,date("m",strtotime($object)),date("d",strtotime($object)),date("Y",strtotime($object))) - mktime(4,12,0,date("m"),date("d"),date("Y")) )/(60 * 60 * 24 * 356);
$return = date("Y") - date("Y", strtotime($object));
if (date("m", strtotime($object)) > date("m") || date("m", strtotime($object)) == date("m") && date("d", strtotime($object)) > date("d")) {
$return--;
}
break;
case "date":
$return = date("d", strtotime($object));
break;
/* mailto */
/* mailto */
case "mailto":
$return = mail_tag($object);
break;
case "empty":
$return = intval($object == NULL);
break;
case "elapsed":
import("date.TimeDate");
$return = TimeDate::elapsed($object);
break;
case "human":
import("date.TimeDate");
$return = TimeDate::human($object);
break;
case "count":
if (is_array($object)) {
$return = intval(count($object));
} else {
if (is_string($object)) {
$return = strlen($object);
} else {
$return = 0;
}
}
break;
case "toup":
$return = strToUpper($object);
break;
case "tolow":
$return = strToLower($object);
break;
case "resume":
array_splice($parameters, 0, 0, $object);
$return = call_user_func_array("resume", $parameters);
break;
case "custom":
//array_splice($parameters,0,0,$object);
$mth = array_shift($parameters);
$return = call_user_func_array($mth, $object);