Loading...
获取Http请求中Host值: $_SERVER["HTTP_HOST"](返回值为域名或IP) 获取服务器IP: GetHostByName($_SERVER['SERVER_NAME']) 接受请求的服务器IP: $_SERVER["SERVER_ADDR"](有时候获取不到,推荐用:GetHostByName($_SERVER['SERVER...
parse_url 是一计算机函数,功能是解析一个 URL 并返回一个关联数组,包含在 URL 中出现的各种组成部分。本函数不是用来验证给定 URL 的合...
时间友好显示,时长友好显示其实都有需求场景,之前都是自己写函数转换,百度搜索了一下发现PHP有自带函数,于是稍作封装,完成了自己的函数。主要用到的函数就是gmdate,这里仅仅是显示了个判断,为了更加友好的显示。function formatSeconds($seconds){ if($seconds > 3600){ return gmdate("H...