1.获取当前日期 date ( string $format [, int $timestamp ] ) : string
,$timestamp
为可选项,一般用法为date('Y-m-d H:i:s')
2.获取当前时间戳 time()
3.字符串转时间戳 strtotime("$today -7 day")
,$today
为date类型的字符串
4.获取数组的键array_keys($array)
array_keys ( array $array [, mixed $search_value = null [, bool $strict = false ]] ) : array
$array为需要查找键的数组
search_value为可选,如果指定了这个参数,只有包含这些值的键才会返回。
strict可选,判断在搜索的时候是否该使用严格的比较(===)。
5. 获取数组中指定列的值 array_column($input,'orderPriceSum')
,这里为返回$input
数组中键为orderPriceSum
的值
array_column ( array $input , mixed $column_key [, mixed $index_key = null ] ) : array
input
需要取出数组列的多维数组。 如果提供的是包含一组对象的数组,只有 public 属性会被直接取出。 为了也能取出 private 和 protected 属性,类必须实现 __get() 和 __isset() 魔术方法。
column_key
需要返回值的列,它可以是索引数组的列索引,或者是关联数组的列的键,也可以是属性名。 也可以是NULL,此时将返回整个数组(配合index_key参数来重置数组键的时候,非常管用)
index_key
作为返回数组的索引/键的列,它可以是该列的整数索引,或者字符串键值。