class IPAddress extends Common { /** * 根据ip地址,获取用户所在省市 */ public function ipIndex() { $ip = "222.22.22.11";// 默认设置一个ip地址(可自行获取) include "../vendor/topthink/Iplocation.php";//引入文件 $Ips =new \IpLocation\IpLocation('UTFWry.dat'); // 实例化类…
var times = Date() // 如果这种方式不行就使用 New Date() "Sat Jan 05 2019 10:35:24 GMT+0800 (中国标准时间)" var arr = String(times).split(" ") [", "10:35:24", "GMT+0800", "(中国标准时间)"]…
昨天在写程序的时候,发现在用户的时候记录IP和地区信息也许以后用得上,去网上找了找,发现实现的方式有好多好多,因为我用的ThinkPHP,后来又去TP官网找了找,最后采用了下面这种方法. <?php // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK IT ] // +--------------------------…