PHP Get QQ QQ information method, PHP get _php Tutorial

Source: Internet
Author: User

PHP to get QQ talent QQ Information method, PHP access


The example of this article describes how to get the QQ QQ information by PHP. Share to everyone for your reference. The specific analysis is as follows:

Add the following points:

① This is a simple routine, through the extension can easily get Tens QQ information, $JSONURL parameters cd=610900 for the city code
②QQ The talent information has been done anti-theft chain, so the use of PHP refer to forge http://city.qq.com
③ originally wanted to do a QQ mail mass software to play, but no economic value, hehe, contribute to everyone reference, very simple.

The specific code is as follows:

Copy the Code code as follows:
<?php
$refer = "http://city.qq.com"; Define $refer
$opt =array (' http ' =>array (' header ' = ' "Referer: $refer")); Request Header Array
$context =stream_context_create ($opt); Create a Send context header message text
$JSONURL = "Http://city.qq.com/json.php?mod=search&act=page&callback=showSrchResult&jsontype=str &perpage=10&cd=610900&nl=3&xb=0&type=city&pg=1 ";
$JSONSTR = Getjson ($jsonUrl, $refer, $context); Calling the JSON proxy function
Echo $jsonStr; Output JSON text
Get QQ Talent JSON data
function Getjson ($url, $referer, $context)
{
$opt =array (' http ' =>array (' header ' = ' "Referer: $referer"));
$context =stream_context_create ($opt);
$GETJSONSTR = File_get_contents ($url, False, $context);
$GETJSONSTR = substr ($getJsonStr, 0,-2);
$GETJSONSTR = substr ($getJsonStr, 15);

return $getJsonStr;
}
?>

I hope this article is helpful to everyone's PHP programming.

http://www.bkjia.com/PHPjc/963846.html www.bkjia.com true http://www.bkjia.com/PHPjc/963846.html techarticle PHP to get QQ talent QQ information method, PHP Get the example of this article about PHP to get QQ QQ information method. Share to everyone for your reference. The specific analysis is as follows: Add the following points: ...

  • 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.