当前位置: 首页>>代码示例>>PHP>>正文


PHP tools::addQuarter方法代码示例

本文整理汇总了PHP中tools::addQuarter方法的典型用法代码示例。如果您正苦于以下问题:PHP tools::addQuarter方法的具体用法?PHP tools::addQuarter怎么用?PHP tools::addQuarter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tools的用法示例。


在下文中一共展示了tools::addQuarter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fetchData

 private static function fetchData($station, $time, $lang, $timeSel)
 {
     include "../includes/getUA.php";
     $request_options = array("referer" => "http://api.irail.be/", "timeout" => "30", "useragent" => $irailAgent);
     $body = "";
     //we want data for 1 hour. But we can only retrieve 15 minutes per request
     for ($i = 0; $i < 4; $i++) {
         $scrapeUrl = "http://www.railtime.be/mobile/SearchStation.aspx";
         $scrapeUrl .= "?l=EN&tr=" . $time . "-15&s=1&sid=" . stations::getRTID($station, $lang) . "&da=" . $timeSel . "&p=2";
         $post = http_post_data($scrapeUrl, "", $request_options) or die("");
         $body .= http_parse_message($post)->body;
         $time = tools::addQuarter($time);
     }
     return $body;
 }
开发者ID:JeroenDeDauw,项目名称:iRail,代码行数:15,代码来源:liveboard.php

示例2: fetchData

 private static function fetchData($station, $time, $lang, $timeSel)
 {
     include "../includes/getUA.php";
     $request_options = array("referer" => "http://api.irail.be/", "timeout" => "30", "useragent" => $irailAgent);
     $body = "";
     //we want data for 1 hour. But we can only retrieve 15 minutes per request
     for ($i = 0; $i < 4; $i++) {
         $scrapeUrl = "http://www.railtime.be/mobile/HTML/StationDetail.aspx";
         $rt = stations::getRTID($station, $lang);
         $rtname = $rt->rtname;
         $rtid = $rt->rtid;
         $scrapeUrl .= "?sn=" . urlencode($rtname) . "&sid=" . urlencode($rtid) . "&ti=" . urlencode($time) . "&da=" . urlencode($timeSel) . "&l=EN&s=1";
         $post = http_post_data($scrapeUrl, "", $request_options) or die("");
         $body .= http_parse_message($post)->body;
         $time = tools::addQuarter($time);
     }
     return $body;
 }
开发者ID:GMLudo,项目名称:iRail,代码行数:18,代码来源:liveboard.php


注:本文中的tools::addQuarter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。