PHP date_sun_info() 函数

PHP 教程 · 2019-01-23 22:27:03

实例

返回有关 2013 年 1 月 1 日,纬度 31.7667,经度 35.2333 的日出/日落和黄昏开始/黄昏结束的信息:

<?php
$sun_info=date_sun_info(strtotime("2013-01-01"),31.7667,35.2333);
foreach ($sun_info as $key=>$val)
{
echo "$key: " . date("H:i:s",$val) . "<br>";
}
?>

定义和用法

date_sun_info() 函数返回一个包含有关指定日期与地点的日出/日落和黄昏开始/黄昏结束的信息的数组。

提示:请参阅 date_sunrise() 函数,返回指定日期与地点的日出时间。

提示:请参阅 date_sunset() 函数,返回指定日期与地点的日落时间。

语法

date_sun_info(timestamp,latitude,longitude);

参数 描述
timestamp 必需。规定时间戳。
latitude 必需。规定纬度。
longitude 必需。规定经度。

技术细节

返回值: 如果成功则返回一个数组,如果失败则返回 FALSE。
PHP 版本: 5.1.2+

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Machine Learning in Action

Machine Learning in Action

Peter Harrington / Manning Publications / 2012-4-19 / GBP 29.99

It's been said that data is the new "dirt"—the raw material from which and on which you build the structures of the modern world. And like dirt, data can seem like a limitless, undifferentiated mass. ......一起来看看 《Machine Learning in Action》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

html转js在线工具
html转js在线工具

html转js在线工具