• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP httpGet函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中httpGet函数的典型用法代码示例。如果您正苦于以下问题:PHP httpGet函数的具体用法?PHP httpGet怎么用?PHP httpGet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: pushMenuToRemote

 public function pushMenuToRemote($button_list)
 {
     $this->refreshToken();
     //需要先执行删除操作,把现有菜单全部删除
     if ($this['agent_id'] > 0) {
         $api = config("wechat_api.qy.menu.delete");
         $api = sprintf($api, $this['access_token'], $this['agent_id']);
     } else {
         $api = config("wechat_api.service.menu.delete");
         $api = sprintf($api, $this['access_token']);
     }
     $result = httpGet($api);
     if ($this['agent_id'] > 0) {
         $api = config("wechat_api.qy.menu.create");
         $api = sprintf($api, $this['access_token'], $this['agent_id']);
     } else {
         $api = config("wechat_api.service.menu.create");
         $api = sprintf($api, $this['access_token']);
     }
     foreach ($button_list as $k => $button) {
         $sub_btn_list = [];
         if (count($button['sub_button']) > 0) {
             foreach ($button['sub_button'] as $i => $child_button) {
                 $sub_btn_list[] = $button_list[$k]['sub_button'][$i];
             }
         }
         unset($button_list[$k]['sub_button']);
         $button_list[$k]['sub_button'] = $sub_btn_list;
     }
     $result = httpPost($api, json_encode(array("button" => $button_list), JSON_UNESCAPED_UNICODE));
     return $result;
     //$result = json_decode($result,true);
     //return array("button"=>$button_list);
 }
开发者ID:Plumes,项目名称:WechatHub,代码行数:34,代码来源:MediaPlatform.php


示例2: __construct

 function __construct($city, $movie = null)
 {
     //        $search = $word;
     //        if (preg_match("~([\w\s]+) (at|in) ([\w\s]+)~", $word, $matches)) {
     //            $this->movie = $matches[1];
     //            $this->near = $matches[3];
     //        } else {
     //            $this->near = $word;
     //        }
     $this->near = $city;
     $this->movie = $movie;
     if ($this->near && $this->movie) {
         //            $url = "http://www.google.co.in/movies?hl=en&near=" . urlencode($this->near) . "&q=" . urlencode($this->movie);
         $url = "http://IP/gwrapper/googlemovies_wrapper.php?near=" . urlencode($this->near) . "&q=" . urlencode($this->movie);
     } else {
         if ($this->near) {
             //            $url = "http://www.google.co.in/movies?hl=en&near=" . urlencode($this->near);
             $url = "http://IP/gwrapper/googlemovies_wrapper.php?near=" . urlencode($this->near);
         }
     }
     echo $url;
     $localmovie_in = httpGet($url);
     if ($this->movie) {
         $this->return = $this->parse_withMovie($localmovie_in);
     } else {
         $this->return = $this->parse($localmovie_in);
     }
 }
开发者ID:superego546,项目名称:SMSGyan,代码行数:28,代码来源:localmovie.php


示例3: _getAccessToken

 private function _getAccessToken()
 {
     //获取access_token;要进行缓存
     $access_token_url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={$this->appid}&secret={$this->appsecret}";
     $json_return = httpGet($access_token_url);
     return $json_return['access_token'];
 }
开发者ID:Aylchen,项目名称:Admin,代码行数:7,代码来源:QrCode.php


示例4: getsrilankajob

function getsrilankajob($url)
{
    echo "<h2> inside job sri lanks</h2>";
    $content = httpGet($url);
    if (preg_match('~<div class="head">(.+)</div>~Usi', $content, $matched)) {
        $title = $matched[1];
        $title = trim(preg_replace("~[\\s]+~", " ", $title));
        $title = trim(str_replace("</h1>", "***", $title));
        $title = trim(str_replace("</h2>", "***", $title));
        $title = strip_tags($title);
        $title = trim(preg_replace("~[\\s]+~", " ", $title));
        $title = trim(str_replace("***", "\n", $title));
        $title = trim(str_replace("\n ", "\n", $title));
    }
    if (preg_match('~<div style="padding: 15px;" class="lightgrey_box">(.+)<span class="clear">~Usi', $content, $matches)) {
        $out = $matches[1];
        $out = trim(preg_replace("~[\\s]+~", " ", $out));
        $out = trim(str_replace("</dd>", "***", $out));
        $out = strip_tags($out);
        $out = trim(preg_replace("~[\\s]+~", " ", $out));
        $out = trim(str_replace("***", "\n", $out));
        $out = trim(str_replace("\n ", "\n", $out));
    }
    if (!empty($title)) {
        return $title . "\n" . $out;
    } else {
        return $out;
    }
}
开发者ID:superego546,项目名称:SMSGyan,代码行数:29,代码来源:job_srilanka.php


示例5: sendSMS

function sendSMS($to, $message)
{
    $username = "shatkonlabs";
    $password = "blueteam@11111p";
    $senderid = "";
    return httpGet("http://www.smsjust.com/blank/sms/user/urlsms.php?" . "username=" . $username . "&pass=" . $password . "&senderid=" . $senderid . "&message=" . $message . "&dest_mobileno=" . $to . "&msgtype=TXT");
}
开发者ID:anil-ninja,项目名称:bluenetV0,代码行数:7,代码来源:functions.php


示例6: getAnswers

 function getAnswers()
 {
     $out = "";
     $url = "API";
     $response = httpGet($url);
     if ($pos1 = strpos($response, 'id="q_answer"')) {
         $pos1 += 14;
         if ($pos2 = strpos($response, "<!-- google_ad_section_end -->", $pos1)) {
             $answer = substr($response, $pos1, $pos2 - $pos1);
             $this->answer = trim(strip_tags($answer));
         }
     } else {
         if (($pos1 = strpos($response, "Is one of these your question?", 0)) !== false) {
             $pos2 = strpos($response, "No? Post your question to the community!", $pos1);
             $sub = substr($response, $pos1, $pos2 - $pos1);
             preg_match_all("~<span onclick=[^<]+><img class=[^>]+>([^<]+)</span>(\\s?<span [^>]+>\\|</span>\\s<span [^>]+>(Unanswered)</span>)?~", $sub, $matches);
             $i = 1;
             foreach ($matches[1] as $key => $match) {
                 if ($matches[3][$key] == "") {
                     $sender = $_GET['number'];
                     $page = mysql_real_escape_string($match);
                     $query = "INSERT INTO lists (sender,number,page,type) VALUES ('{$sender}',{$i},'{$page}','wikianswers')";
                     mysql_query($query) or die(mysql_error() . " in {$query}");
                     $out .= "{$i}. {$match}\n";
                     $i++;
                 }
             }
             if ($out !== "") {
                 $out = "Is one of these your question? Reply GYAN OPTION (e.g GYAN 1)\n" . $out;
             }
             $this->answer = trim(strip_tags($out));
         }
     }
 }
开发者ID:superego546,项目名称:SMSGyan,代码行数:34,代码来源:wikianswers.php


示例7: sendProSMS

function sendProSMS($to, $message)
{
    $username = "rajnish90";
    $password = "redhat123";
    $senderid = "BLUETM";
    $url = "http://www.smsjust.com/blank/sms/user/urlsms.php?" . "username=" . $username . "&pass=" . $password . "&senderid=" . $senderid . "&dest_mobileno=" . $to . "&msgtype=TXT" . "&message=" . urlencode($message) . "&response=Y";
    //echo $url;
    return httpGet($url);
}
开发者ID:rajnishp,项目名称:api_bluenet,代码行数:9,代码来源:sms.php


示例8: __construct

 function __construct()
 {
     echo "<br>India Earnings<br>";
     global $word;
     echo $url = "http://indiaearnings.moneycontrol.com/sub_india/compsearch_result.php?companyname=" . urlencode($word) . "&fname=price&searchtype=new";
     $indiaearnings_in = httpGet($url);
     //      var_dump($indiaearnings_in);
     $this->setCompany($indiaearnings_in);
     var_dump($this->company);
     var_dump($this->company_code);
 }
开发者ID:superego546,项目名称:SMSGyan,代码行数:11,代码来源:indiaearnings.php


示例9: getPersonWithProfession

function getPersonWithProfession($profession, $key)
{
    $url = "https://api.deutsche-digitale-bibliothek.de/entities?rows=10000&query=professionOrOccupation:" . str_replace("\"", "", json_encode($profession));
    $httpResult = httpGet($url, array("Authorization" => "OAuth oauth_consumer_key=\"" . $key . "\""));
    $resultJson = json_decode($httpResult);
    if (property_exists($resultJson, "results") && count($resultJson->results) > 0 && property_exists($resultJson->results[0], "docs")) {
        $results = $resultJson->results[0]->docs;
    } else {
        $results = array();
    }
    return $results;
}
开发者ID:sakonet,项目名称:kunstquiz,代码行数:12,代码来源:DDBrequests.php


示例10: downloadHeadImg

 /**
  * 下载图像
  */
 public function downloadHeadImg()
 {
     ignore_user_abort(true);
     set_time_limit(0);
     for ($i = 100; $i > 0; $i++) {
         $rt = $this->table('task_headimgdownload')->where(array('status' => 0))->get();
         if (!$rt) {
             $this->setTimeOut($i);
             continue;
         }
         $tempPath = '../TempImg/';
         $path = 'img/headImg/';
         foreach ($rt as $a) {
             //先验证是否已更换图片
             $user = $this->table('user')->where(array('id' => $a['user_id']))->get(array('photo'), true);
             if ($user['photo'] != $a['photo']) {
                 $status = 3;
             } else {
                 $img = httpGet($a['photo']);
                 $fileName = time() . rand(10000, 99999) . '.jpg';
                 $save = file_put_contents($tempPath . $fileName, $img);
                 if ($save) {
                     $uploadStatus = true;
                     $image = new \System\lib\Image\Image($tempPath . $fileName);
                     $fileName2 = str_replace('.jpg', '_150.jpg', $fileName);
                     $image->thumb(200, 10000)->save($tempPath . $fileName2);
                     $status = 1;
                     //上传到图片服务器
                     $upload = httpPost($this->config('IMG_UPLOAD'), ['file' => new \CURLFile(realpath($tempPath . $fileName)), 'savePath' => $path, 'saveName' => basename($tempPath . $fileName)], true);
                     $upload = json_decode($upload, true);
                     if (!($upload && $upload['result'] == true)) {
                         $uploadStatus = false;
                     }
                     //上传压缩图
                     $upload2 = httpPost($this->config('IMG_UPLOAD'), ['file' => new \CURLFile(realpath($tempPath . $fileName2)), 'savePath' => $path, 'saveName' => basename($tempPath . $fileName2)], true);
                     $upload2 = json_decode($upload, true);
                     if (!($upload2 && $upload2['result'] == true)) {
                         $uploadStatus = false;
                     }
                     if ($uploadStatus == false) {
                         $status = 2;
                     } else {
                         $up2 = $this->table('user')->where(['id' => $a['user_id']])->update(['photo' => '/', $path . $fileName, 'photo_150' => '/', $path . $fileName2]);
                         $status = 1;
                     }
                 } else {
                     $status = 2;
                 }
             }
             $up = $this->table('task_headimgdownload')->where(['id' => $a['id']])->update(array('status' => $status, 'execute_time' => time()));
         }
     }
 }
开发者ID:phpchen,项目名称:yiyuangou,代码行数:56,代码来源:IndexController.class.php


示例11: getAnswer

 function getAnswer()
 {
     $content = httpGet($this->url);
     if (preg_match("~<div class=\"answer_text\" id=\"editorText\">(.+)</div>~Usi", $content, $match)) {
         $WikiAns = trim(strip_tags($match[1]));
         $WikiAns = html_entity_decode($WikiAns);
     }
     if (!empty($WikiAns)) {
         $this->output = $WikiAns;
         return $this->output;
     }
 }
开发者ID:superego546,项目名称:SMSGyan,代码行数:12,代码来源:class.wikianswer.php


示例12: jobdetails

 function jobdetails($url)
 {
     echo $url = "http://kenyanjobs.blogspot.com/" . trim($url);
     $content = httpGet($url);
     if (preg_match('~<div dir="ltr" style="text-align: left;" trbidi="on">(.+)<div style=\'text-align: center;\'><br/><br/>~Usi', $content, $match)) {
         $data = $match[1];
         $data = preg_replace('~[\\s]+~', " ", $data);
         $data = strip_tags($data);
         $this->return["job"] = $data;
     } else {
         $this->return["job"] = "No data found";
     }
 }
开发者ID:superego546,项目名称:SMSGyan,代码行数:13,代码来源:job_kenya.php


示例13: getipinfo

function getipinfo()
{
    header("Content-Type:text/html;   charset=utf-8");
    $url = 'http://1111.ip138.com/ic.asp';
    //这儿填页面地址
    $info = httpGet($url);
    $p = "%<center>(.*?)</center>%si";
    preg_match_all($p, $info, $arr);
    $info = $arr[1];
    $str1 = explode("[", iconv('GB2312', 'UTF-8', $info[0]));
    $str2 = explode("]", $str1[1]);
    $ip = $str2[0] . '_' . substr($str2[1], 10);
    return $ip;
}
开发者ID:jl9n,项目名称:phpstudy,代码行数:14,代码来源:ip.php


示例14: getlist

function getlist($url)
{
    $content = httpGet($url);
    $p = '/<span class=\\"tit\\">(.*?)<\\/span>/is';
    preg_match_all($p, $content, $arr);
    if ($arr[1]) {
        foreach ($arr[1] as $k => $v) {
            $pre = trim($v);
            $st = explode('title="', $pre);
            $st = explode('">', $st[1]);
            echo trim($st[0]) . '
';
        }
    }
}
开发者ID:xtzlyp,项目名称:Api,代码行数:15,代码来源:getPp.php


示例15: runAll

function runAll()
{
    global $servers;
    file_put_contents('var/locales', json_encode(array_keys($servers)));
    foreach ($servers as $locale => $server) {
        $account = 'royalAdmin';
        $pass = 'royalPass';
        if (!empty($server['account'])) {
            $account = $server['account'];
            $pass = $server['pass'];
        }
        httpPost($server['login_url'], array('account' => $account, 'password' => $pass, 'submit' => true));
        $dashboard = httpGet($server['dashboard_url'], array());
        preg_match('/var statisDatas = ([^;]*);/sim', $dashboard, $data);
        $dataArray = json_decode($data[1], true);
        handleData($locale, $dataArray);
    }
}
开发者ID:xinghuwang,项目名称:toolbox,代码行数:18,代码来源:fetch.php


示例16: definition

 function definition()
 {
     $search = rawurlencode($this->query);
     $url = "API";
     $response = httpGet($url);
     $xmlObj = simplexml_load_string($response);
     $arrXml = objectsIntoArray($xmlObj);
     //print_r($arrXml);
     //echo count($arrXml['definitions']);
     if (count($arrXml) > 0) {
         if (isset($arrXml['definition']['text'])) {
             echo $arrXml['definition']['text'];
         } else {
             foreach ($arrXml['definition'] as $i => $definition) {
                 echo $i + 1 . ". " . $definition['text'] . "\n";
             }
         }
     }
 }
开发者ID:superego546,项目名称:SMSGyan,代码行数:19,代码来源:wordnik.php


示例17: xuanWuMsm

 /**
  *  玄武科技短信接口
  */
 public static function xuanWuMsm($phone, $content)
 {
     $url = \System\Entrance::config('MSM_URL') . "username=" . \System\Entrance::config('MSM_ACCOUNT') . "&password=";
     $url .= \System\Entrance::config('MSM_PWD') . "&to=" . $phone . "&text=" . urlencode(iconv('utf-8', 'gb2312', $content)) . "&subid=&msgtype=1";
     $send = httpGet($url);
     if ($send === false) {
         $retrun = array("result" => false, "info" => "接口请求失败!");
         return $retrun;
     }
     $result = false;
     $info = "";
     switch ($send) {
         case "0":
             $result = true;
             $info = "发送成功!";
             break;
         case "-2":
             $info = "发送参数填定不正确!";
             break;
         case "-3":
             $info = "用户载入延迟!";
             break;
         case "-6":
             $info = "密码错误!";
             break;
         case "-7":
             $info = "用户不存在!";
             break;
         case "-11":
             $info = "发送号码数理大于最大发送数量";
             break;
         case "-12":
             $info = "余额不足";
             break;
         case "-99":
             $info = "内部处理错误";
             break;
         default:
             $info = "其他错误";
             break;
     }
     return array("result" => $result, "info" => $info);
 }
开发者ID:phpchen,项目名称:yiyuangou,代码行数:46,代码来源:AppTools.class.php


示例18: searchednews

 function searchednews($url)
 {
     $content = httpGet($url);
     if (preg_match_all('~<h2 class="entry-title"><a href="(.+)/" title="(.+)" rel=".+">~Usi', $content, $match)) {
         if (count($match[1] > 1)) {
             $this->return["news"] = "Your query matches more than one result";
             for ($i = 0; $i < count($match[1]); $i++) {
                 $title = trim(strip_tags($match[2][$i]));
                 $link = trim(strip_tags($match[1][$i]));
                 $this->return["options"][] = $title;
                 $this->return["list"][] = array("content" => "__nigerianews__" . $link . "__");
             }
         } else {
             $this->return["news"] = "No data found";
         }
     } else {
         $this->return["news"] = "No data found";
     }
 }
开发者ID:superego546,项目名称:SMSGyan,代码行数:19,代码来源:NG_news.php


示例19: getcontent

function getcontent($url)
{
    global $db;
    $data = httpGet($url);
    preg_match('/<title>(.*)<\\/title>/', $data, $title);
    preg_match('/<div class=\\"rich_media_content \\" id=\\"js_content\\">(.*)<div class=\\"rich_media_area_extra\\">/is', $data, $content);
    $title = $title[1];
    $content = $content[0];
    $content = str_replace('http://mmbiz.qpic.cn', 'http://img01.store.sogou.com/net/a/04/link?appid=100520031&w=900&h=105&url=http://mmbiz.qpic.cn', $content);
    $content = str_replace('fieldset', 'p', $content);
    $content = str_replace('data-src', 'src', $content);
    $content = explode('<script', $content);
    $content = $content[0];
    if (!$title || !$content) {
        return false;
    }
    return array('title' => $title, 'content' => $content);
    //$pids=array(1,2,3,4,5,6,7,8,9,10,11,12,13,14);
    //$piddd=$pids[rand(0,29)];
    //$storeInfo = $db->table('a_tmall_wx')->insert();
}
开发者ID:xtzlyp,项目名称:lxweb,代码行数:21,代码来源:1.php


示例20: getcontent

 public function getcontent($url, $pid)
 {
     $data = httpGet($url);
     preg_match('/<title>(.*)<\\/title>/', $data, $title);
     preg_match('/<div class=\\"rich_media_content \\" id=\\"js_content\\">(.*)<div class=\\"rich_media_area_extra\\">/is', $data, $content);
     $title = $title[1];
     $content = $content[0];
     $content = str_replace('http://mmbiz.qpic.cn', 'http://img01.store.sogou.com/net/a/04/link?appid=100520031&w=900&h=105&url=http://mmbiz.qpic.cn', $content);
     $content = str_replace('fieldset', 'p', $content);
     $content = str_replace('data-src', 'src', $content);
     $content = explode('<script', $content);
     $content = $content[0];
     if (!$title || !$content) {
         echo 'mmmm';
         die;
     }
     $sql = "insert into csm_a_use (title,content,times,p_id,froms) values ('" . $title . "','" . $content . "','" . time() . "','" . $pid . "','weixin');";
     $this->db->query($sql);
     $upSql = "update csm_ul set type=2 where id=" . $pid;
     $this->db->query($upSql);
 }
开发者ID:xtzlyp,项目名称:Api,代码行数:21,代码来源:getCont.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP httpPost函数代码示例发布时间:2022-05-15
下一篇:
PHP http函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap