PHP API get weather forecast, and use Fetion API to send _php tutorial to friends

Source: Internet
Author: User
API get weather forecast, and use Fetion API to send SMS to friends
Plus the scheduled task, you can continue to send daily weather forecast to yourself and loved ones ...

5 && Strtolower (substr ($url, 0,5)) = = "https") {curl_setopt ($ch, Curlopt_ssl_verifypeer, false); Curl_setopt ($ CH, curlopt_ssl_verifyhost, false);} if (Is_array ($postFields) && 0 < count ($postFields)) {$postBodyString = ""; $postMultipart = False;foreach ($ Postfields as $k = = $v) {if ("@"! = substr ($v, 0, 1))//Determine if file upload {$postBodyString. = "$k =". UrlEncode ($v). "&"; }else//file upload with Multipart/form-data, otherwise with www-form-urlencoded{$postMultipart = True;}} Unset ($k, $v); curl_setopt ($ch, Curlopt_post, True), if ($postMultipart) {curl_setopt ($ch, Curlopt_postfields, $ Postfields);} Else{curl_setopt ($ch, Curlopt_postfields, substr ($postBodyString, 0,-1));}} $reponse = curl_exec ($ch); if (Curl_errno ($ch)) {throw new Exception (Curl_error ($ch), 0);} else{$httpStatusCode = Curl_getinfo ($ch, Curlinfo_http_code), if (!== $httpStatusCode) {throw new Exception ($reponse , $httpStatusCode);}} Curl_close ($ch); return $reponse;} function Object_to_array ($obj) {$_arr = Is_object ($obj)? Get_object_vars ($oBJ): $obj, foreach ($_arr as $key = + $val) {$val = (Is_array ($val) | | is_object ($val))? Object_to_array ($val): $val; $a rr[$key] = $val;} return $arr;}? >

http://www.bkjia.com/PHPjc/735146.html www.bkjia.com true http://www.bkjia.com/PHPjc/735146.html techarticle API get weather forecast, and use Fetion API, send friends SMS plus scheduled tasks, you can continue to automatically send daily weather forecast to yourself and loved ones ...? php#########

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.