Home  >  Article  >  Backend Development  >  Detailed explanation of obtaining email address based on PHP CURL_PHP tutorial

Detailed explanation of obtaining email address based on PHP CURL_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:09:55776browse

CURL can be described as a must-have killer medicine for home travel. Why is it so described? It is because it is easy to use and can realize a series of functions such as page grabbing, simulated login collection and so on.
I remember that the first time I came into contact with CURL was to complete the crawling from the mailbox user list. At that time, in order to catch up with the progress, I didn't study it in detail. I just found some information on the Internet and implemented the function. Now after organizing the original code, the function can still be used

Copy the code The code is as follows:

error_reporting ( 0 );
set_time_limit ( 0 );
header ( "Content-Type: text/html; charset=GB2312" );

//Email username and password
$user = 'username';
$pass = 'password';

//Create a file to store cookie information
define ( "COOKIEJAR", tempnam ( ini_get ( "upload_tmp_dir" ), " cookie" ) );

$url = 'http://reg.163.com/logins.jsp?type=1&url=http://entry.mail.163.com/coremail/fcg/ntesdoor2 ?lightweight%3D1%26verifycookie%3D1%26language%3D-1%26style%3D-1';
$refer = 'http://mail.163.com';
$fields_post = array ('username ' => $user, 'password' => $pass, 'verifycookie' => 1, 'style' => - 1, 'product' => 'mail163', 'selType' => - 1, 'secure' => 'on' );
$fields_string = http_build_query ( $fields_post, '&' );
$headers_login = array ('User-Agent' => 'Mozilla/5.0 ( Windows; U; Windows NT 5.1; zh-CN; rv:1.9) Gecko/2008052906 Firefox/3.0', 'Referer' => 'http://www.163.com' );

/ /Login
$ch = curl_init ( $url );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt ( $ch, CURLOPT_HEADER, true );
curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 120 );
curl_setopt ( $ch, CURLOPT_POST, true );
curl_setopt ( $ch, CURLOPT_REFERER, $refer );
curl_setopt ( $ch, CURLOPT_COOKIESESSION, true );
curl_setopt ( $ch , CURLOPT_COOKIEJAR, COOKIEJAR );
curl_setopt ( $ch, CURLOPT_HTTPHEADER, $headers_login );
curl_setopt ( $ch, CURLOPT_POST, count ( $fields ) );
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $fields _string ) ;
$result = curl_exec ( $ch );
curl_close ( $ch );

//Jump
$url = 'http://entry.mail.163.com /coremail/fcg/ntesdoor2?lightweight=1&verifycookie=1&language=-1&style=-1&username=loki_wuxi';
$headers = array ('User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1 ; zh-CN; rv:1.9) Gecko/2008052906 Firefox/3.0' );

$ch = curl_init ( $url );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt ( $ch, CURLOPT_HEADER, true );
curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 120 );
curl_setopt ( $ch, CURLOPT_POST, true );
curl_setopt ( $ch, CURLOPT_HTTPHEADER, $headers );
curl_setopt ( $ch, CURLOPT_COOKIEFILE, COOKIEJAR );
curl_setopt ( $ch, CURLOPT_COOKIEJAR, COOKIEJAR );
$result = curl_exec ( $ch );
curl_close ( $ch );

//Get sid
preg_match ( '/sid=[^"].*/', $result, $location );
$sid = substr ( $location [0], 4, - 1 ) ;

//Address book address
$url = 'http://g4a30.mail.163.com/jy3/address/addrlist.jsp?sid=' . $sid . '&gid=all ';
$headers = array ('User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9) Gecko/2008052906 Firefox/3.0' );

$ch = curl_init ( $url );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt ( $ch, CURLOPT_HEADER, true );
curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 120 );
curl_setopt ( $ch, CURLOPT_POST, true );
curl_setopt ( $ch, CURLOPT_HTTPHEADER, $headers );
curl_setopt ( $ch, CURLOPT_COOKIEFILE, COOKIEJAR );
curl_setopt ( $ch, CURLOPT_COOKIEJAR, COOKIEJAR );
$result = curl_exec ( $ch );
curl_close ( $ch );
unlink ( COOKIEJAR );

//Start crawling content
preg_match_all ( '/]*>(.*?)< ;a[^>]*>(.*?)/i', $result, $infos, PREG_SET_ORDER );
//1: Name 2: Email
print_r ( $infos );
?>

Create a PHP file, copy the above code and save it. The effect will be immediate. Remember to change your email account and password. The account does not need the @ suffix. My first experience with CURL, how about it, not bad.
Later, I saw someone posting on CSDN asking a question about getting express delivery queries. He wanted to put some large express delivery company query services on one page. It is indeed a very good and practical tool, but because express delivery queries have The verification code reminds me of the CURL tool. Later, I helped the post owner implement the function. The idea was very simple. First, use CURL to simulate grabbing the verification code, and then display it on the user submission page. At the same time, the COOKIE and other user queries that save the verification code are submitted together to ensure the synchronization of COOKIE.

The source code is as follows:
-getEms.html
Copy code The code is as follows:

< ;html>


EMS Express Inquiry< /title><br> </head><br> <body><br> <?php<BR> fclose(fopen('cookie.txt','w')); //File cookie.txt Used to store the obtained cookie<BR> $cookiejar = realpath('cookie.txt');<BR> $fp = fopen("example_homepage.txt", "w"); //The file example_homepage.txt is used to store the obtained cookie Page content<BR> $ch = curl_init("http://www.ems.com.cn/servlet/ImageCaptchaServlet");<BR> curl_setopt($ch, CURLOPT_FILE, $fp);<BR> curl_setopt($ ch, CURLOPT_COOKIESESSION, 1);<BR> curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiejar);<BR> curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);<BR> curl_setopt($ch, CURLOPT_HEADER, 0);<BR> curl_exec($ch);<BR> curl_close($ch);<BR> fclose($fp);<br><br> //readfile($cookiejar); //View the retrieved cookies<BR> / /readfile("example_homepage.jpg"); //View the retrieved pictures<BR> ?><br> <form action="getems.php" method="post" name="form1"><br> Courier number: <input name="mailNum" type="text" value="EA739701017CS" /> (The first and last 2 digits of the 13 digits are letters)<br> <input name="code" type="text " value="" /><br> <?php echo "<img src='example_homepage.txt'>";?><br> <input type="submit" value="Submit" ><br> </form><br><br> </body><br> </html><br> </div> <br>-getems.php<br><div class="codetitle"> <span style="CURSOR: pointer" onclick="doCopy('code71043')"><u>Copy code</u></span> The code is as follows:</div> <div class="codebody" id="code71043"> <br><?php<BR> if($_POST){<BR> //Use the cookie file of the previous verification code<BR> $cookiejar = realpath('cookie.txt');<BR> //Get myEmsbarCode number and verification code variable name<BR> $ch = curl_init("http://www.ems.com.cn"); <BR> curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<BR> curl_setopt($ch, CURLOPT_HEADER, 0);<BR> curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);<BR> curl_setopt($ch, CURLOPT_CO OKIEJAR, $cookiejar);<BR> $result = curl_exec($ch);<BR> curl_close($ch);<BR> preg_match("/<input type="hidden" name="myEmsbarCode" value="(. *)"/>/isU",$result,$myEmsbarCode);<br> preg_match("/</span><input name="(.*)" type="text"/isU",$ result,$codename);<br><br> $parm = array($codename[1]=>$_POST['code'],<br> mailNum =>$_POST['mailNum'],<br> myEmsbarCode=>$myEmsbarCode[1],<br> reqCode=>'browseBASE'<br> );<br><br> $ch = curl_init("http://www.ems.com.cn/ qcgzOutQueryAction.do");<br> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);<br> curl_setopt($ch, CURLOPT_HEADER, 0);<br> curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);<br> curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookiejar);<br> curl_setopt($ch, CURLOPT_POST, 1);<br> curl_setopt($ch, CURLOPT_REFERER, "http://www.ems.com.cn");<br> curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($parm));<br> $_source = curl_exec($ch);<br> curl_close($ch);<br><br> //Get it done<br> var_dump( $_source);<br> exit;<br> }<br> ?><br> </div> <br>For a detailed explanation of the parameters of the CURL library, there are many on the Internet that I directly included <br> Function list There are 17 functions in the CURL library: <br>curl_close: close the CURL session <br>curl_copy_handle: copy a CURL session handle, and at the same time 3 Copy all its parameters <br>curl_errno: Return the last error code <br>curl_error: Return a string to describe the last error of the current session <br>curl_exec: Execute the current session <br>curl_getinfo: Get specific information <br>curl_init: Initialize CURL session <br>curl_multi_add_handle: Add a handle to a multi-connection session <br>curl_multi_close: Close a multi-handle CRUL session <br>curl_multi_exec: Execute a multi-handle CURL session <br>curl_multi_getcontent: Return The content after a handle is executed, if CURLOPT_RETURNTRANSFER is set <br> curl_multi_info_read: Get information about all current connections <br> curl_multi_init: Initialize a multi-handle session <br> curl_multi_remove_handle: Remove a handle from a multi-handle session <br> curl_multi_select : Get all bound sockets <br> curl_setopt: Set CURL transmission options <br> curl_version: Get CURL version <br> Common setting options Boolean options <br> CURLOPT_AUTOREFERER: When the returned information header contains redirection information, Automatically set forward connections <br>CURLOPT_BINARYTRANSFER: TRUEtoreturntherawoutputwhenCURLOPT_RETURNTRANSFERisused.<br>CURLOPT_COOKIESESSION: Flag for a new cookie session, ignore previously set cookie sessions <br>CURLOPT_CRLF: Convert Unix system newlines to Dos newlines <br>CURLOPT_DNS _USE_GLOBAL_CACHE : Use the global DNS cache <br>CURLOPT_FAILONERROR: Ignore the returned error <br>CURLOPT_FILETIME: Get the modification date of the requested document, which can be obtained with curl_getinfo(). <br>CURLOPT_FOLLOWLOCATION: Follow all redirect information returned by the server <br>CURLOPT_FORBID_REUSE: Force the session to be closed when the process is completed, and no longer cache it for reuse <br>CURLOPT_FRESH_CONNECT: Force the establishment of a new session instead of reusing the cached one Session<br>CURLOPT_HEADER: Include response header information in the returned output<br>CURLOPT_HTTPGET: Set the HTTP request method to GET<br>CURLOPT_HTTPPROXYTUNNEL: Establish a connection via an HTTP proxy<br>CURLOPT_NOBODY: The returned output does not include document information .<br>CURLOPT_NOPROGRESS: Disable process-level transmission, PHP automatically sets to true<br>CURLOPT_NOSIGNAL: Ignore all information sent to PHP<br>CURLOPT_POST: Set the POST method to submit data, the POST format is application/x-www-form- urlencoded<br>CURLOPT_PUTTRUE: Set the PUT method to upload files, and set CURLOPT_INFILE and CURLOPT_INFILESIZE at the same time<br>CURLOPT_RETURNTRANSFER: Return a string instead of directly outputting after calling curl_exec()<br>CURLOPT_SSL_VERIFYPEER: SSL verification is turned on<br>CURLOPT_UNRESTRIC TED_AUTH: always linked Append the username and password, and set CURLOPT_FOLLOWLOCATION<br>CURLOPT_UPLOAD: Prepare to upload integer value options<br>CURLOPT_BUFFERSIZE: Cache size<br>CURLOPT_CONNECTTIMEOUT: Connection time setting, default 0 is unlimited<br>CURLOPT_DNS_CACHE_TIMEOUT: Save DNS information in memory time, default 2 minutes <br>CURLOPT_INFILESIZE: file size uploaded to the remote site <br>CURLOPT_LOW_SPEED_LIMIT: minimum transmission speed limit andabort.<br>CURLOPT_LOW_SPEED_TIME: transmission time limit <br>CURLOPT_MAXCONNECTS: maximum number of persistent connections <br>CURLOPT_MAXREDIRS : Maximum number of turns <br>CURLOPT_PORT: Connection port <br>CURLOPT_PROXYAUTH: ******Verification method <br>CURLOPT_PROXYPORT: ******Port <br>CURLOPT_PROXYTYPE: ******Type<br>CURLOPT_TIMEOUT: Maximum execution time string option of CURL function <br>CURLOPT_COOKIE: cookie information in set-cookie in HTTP header <br>CURLOPT_COOKIEFILE: file containing cookie information. The format of cookie file can be Netscape format, or just HTTP header format. <br>CURLOPT_COOKIEJAR: A file that saves cookie information after the connection is completed <br>CURLOPT_CUSTOMREQUEST: Custom request header, using relative address <br>CURLOPT_ENCODING: The value of Accept-Encoding in the HTTP request header <br>CURLOPT_POSTFIELDS: Data submitted in POST format Content<br>CURLOPT_PROXY: proxy channel<br>CURLOPT_PROXYUSERPWD: proxy authentication username and password<br>CURLOPT_RANGE: range of returned data, in bytes<br>CURLOPT_REFERER: forward link<br>CURLOPT_URL: URL address to connect to , can be set in curl_init() <br>CURLOPT_USERAGENT: the value of User-Agent in the HTTP header <br>CURLOPT_USERPWD: the verification information array option used for the connection <br>CURLOPT_HTTP200ALIASES: 200 response code array, is the response in the array used? Considered a correct response <br>CURLOPT_HTTPHEADER: Custom request header information can only be options for stream handles: <br>CURLOPT_FILE: Transfer the evening handle to be written, the default is standard output <br>CURLOPT_INFILE: Transfer the evening handle to be read File handle <br>CURLOPT_STDERR: As a replacement option for standard error output <br>CURLOPT_WRITEHEADER: The file callback function option to which the transfer header information is written <br>CURLOPT_HEADERFUNCTION: A callback function with two parameters, the first parameter is The session handle, and the second is a string of HTTP response header information. Using this callback function, the response header information will be processed by itself. Response header information is returned line by line. Set the return value to the string length.<br>CURLOPT_READFUNCTION: A callback function with two parameters. The first parameter is the session handle, and the second parameter is the string of HTTP response header information. Using this function, the returned data will be processed yourself. The return value is the data size. <br>CURLOPT_WRITEFUNCTION: A callback function with two parameters. The first parameter is the session handle, and the second parameter is the string of HTTP response header information. Using this callback function, the response header information will be processed by itself. The response header information is the entire string. Set the return value to the string length. <br>Some other CURL examples (excerpted from the Internet)<br><div class="codetitle"> <span style="CURSOR: pointer" onclick="doCopy('code10564')"><u>Copy code</u></span> The code is as follows:</div> <div class="codebody" id="code10564"> <br> /*<br> * Determine whether a url is a valid link <br> */<br> function isRealUrl($url){<br> $ch = curl_init();<br> $options = array(<br> CURLOPT_URL => $url, <br> Curlopt_header = & GT; TRUE, <br> Curlopt_returntransfer = & GT; TRUE, <br> Curlopt_nobody = & GT; TRUE <br>); <br> Curl_Setopt_ar ray ($ ch, $ options); <br> Curl_exec ($ CH );<br> if(!curl_errno($ch)){<br> return 200==curl_getinfo($ch,CURLINFO_HTTP_CODE)?true:false;<br> }<br> curl_close($ch);<br> }<br><br> $url = 'http://testpic1.tomoimg.cn/240x180/394/855/517932781/200901/12312215602409.jpg';<br> if(isRealUrl($url)){echo ' yes';}else{echo 'no';}<br><br> /Example of asynchronous request:<br> $userid = 517932781;<br> $imageid = 1520;<br> $albumid = 2637;<br> $tags = 'aa';<br> extract($_POST);<br> $url = 'http://'.$_SERVER['HTTP_HOST'].'/ajax/image.php';<br> $fields = array(<br> 'userid' => $userid,<br> 'imageid' => $imageid,<br> 'albumid' => $albumid,<br> 'tags' => $tags,<br> 'optype' => 'del'<br> );<br> $ch = curl_init() ;<br> curl_setopt($ch, CURLOPT_URL,$url) ;<br> curl_setopt($ ch, CURLOPT_POST,true) ;<br> curl_setopt($ch, CURLOPT_POSTFIELDS,$fields) ;<br> $result = curl_exec($ch) ;<br> curl_close($ch) ;<br><br> // Upload files<br> $ch = curl_init();<br> curl_setopt($ch,CURLOPT_URL,'http://lh.tom.com/deal/import.php');<br> $fields = array(<br> 'tname' => 'Tao Te Ching',<br> 'country' => 1,<br> 'author' => 'Lao Tzu',<br> 'tags' => 'Tao Te Ching' ,<br> 'desc' => 'The Tao can be Tao, but it is very Tao. Famous, very famous. The beginning of the nameless world. Known as the mother of all things. Therefore, I always have no desire to observe its wonders. I always have the desire to watch him. The two have the same origin but different names, and they are both called xuan. Mysterious and mysterious, the door to all mysteries. ',<br> 'volume' => 2,<br> 'cover' => '@'.realpath('/data/lianhuanhua/deal/1.jpg')<br> );<br> curl_setopt ($ch, CURLOPT_POST, true) ;<br> curl_setopt($ch, CURLOPT_POSTFIELDS, $fields) ;<br> curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);<br> $result = curl_exec($ch);<br> curl_close($ch);<br><br> //Multiple file upload<br> $ch = curl_init();<br> curl_setopt($ch,CURLOPT_URL,'http://lh.tom.com/deal /addpic.php');<br> $j = 0;<br> $fields = array(<br> 'vid' => 103,<br> 'upfile['.$j++.']' => ; '@'.realpath('/data/lianhuanhua/deal/1.jpg'),<br> 'upfile['.$j++.']' => '@'.realpath('/data/lianhuanhua/ deal/2.jpg')<br> );<br> curl_setopt($ch, CURLOPT_POST, true) ;<br> curl_setopt($ch, CURLOPT_POSTFIELDS, $fields) ;<br> curl_setopt($ch, CURLOPT_RETURNTRANSFER, false );<br> $result = curl_exec($ch);<br> curl_close($ch);<br> </div> <br>When you master the php curl library, you can do a lot of things you want to do , Haha, I recently played the X world on Kaixin.com, and the combat was really cumbersome. I directly wrote a combat assistant that was very easy to use. This code will not be open sourced:) It can be implemented in open source just like mastering the principles. <br>Website Counter<br> <p align="left"></p> <div style="display:none;"> <span id="url" itemprop="url">http://www.bkjia.com/PHPjc/327185.html</span><span id="indexUrl" itemprop="indexUrl">www.bkjia.com</span><span id="isOriginal" itemprop="isOriginal">true</span><span id="isBasedOnUrl" itemprop="isBasedOnUrl">http: //www.bkjia.com/PHPjc/327185.html</span><span id="genre" itemprop="genre">TechArticle</span><span id="description" itemprop="description">CURL can be said to be a must-have killer medicine for home travel. Why is it so described? It is because it is easy to use and can realize a series of functions such as page grabbing, simulated login collection and so on. I remember the first time I came into contact with CURL...</span> </div> <div class="art_confoot"></div></div><div class="nphpQianMsg"><div class="clear"></div></div><div class="nphpQianSheng"><span>Statement:</span><div>The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn</div></div></div><div class="nphpSytBox"><span>Previous article:<a class="dBlack" title="Detailed explanation of simple comparison table based on MySQL to MongoDB_PHP tutorial" href="http://m.php.cn/faq/307851.html">Detailed explanation of simple comparison table based on MySQL to MongoDB_PHP tutorial</a></span><span>Next article:<a class="dBlack" title="Detailed explanation of simple comparison table based on MySQL to MongoDB_PHP tutorial" href="http://m.php.cn/faq/307853.html">Detailed explanation of simple comparison table based on MySQL to MongoDB_PHP tutorial</a></span></div><div class="nphpSytBox2"><div class="nphpZbktTitle"><h2>Related articles</h2><em><a href="http://m.php.cn/article.html" class="bBlack"><i>See more</i><b></b></a></em><div class="clear"></div></div><ul class="nphpXgwzList"><li><b></b><a href="http://m.php.cn/faq/1.html" title="How to use cURL to implement Get and Post requests in PHP" class="aBlack">How to use cURL to implement Get and Post requests in PHP</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/faq/1.html" title="How to use cURL to implement Get and Post requests in PHP" class="aBlack">How to use cURL to implement Get and Post requests in PHP</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/faq/1.html" title="How to use cURL to implement Get and Post requests in PHP" class="aBlack">How to use cURL to implement Get and Post requests in PHP</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/faq/1.html" title="How to use cURL to implement Get and Post requests in PHP" class="aBlack">How to use cURL to implement Get and Post requests in PHP</a><div class="clear"></div></li><li><b></b><a href="http://m.php.cn/faq/2.html" title="All expression symbols in regular expressions (summary)" class="aBlack">All expression symbols in regular expressions (summary)</a><div class="clear"></div></li></ul></div></div><div class="nphpFoot"><div class="nphpFootBg"><ul class="nphpFootMenu"><li><a href="http://m.php.cn/"><b class="icon1"></b><p>Home</p></a></li><li><a href="http://m.php.cn/course.html"><b class="icon2"></b><p>Course</p></a></li><li><a href="http://m.php.cn/wenda.html"><b class="icon4"></b><p>Q&A</p></a></li><li><a href="http://m.php.cn/login"><b class="icon5"></b><p>My</p></a></li><div class="clear"></div></ul></div></div><div class="nphpYouBox" style="display: none;"><div class="nphpYouBg"><div class="nphpYouTitle"><span onclick="$('.nphpYouBox').hide()"></span><a href="http://m.php.cn/"></a><div class="clear"></div></div><ul class="nphpYouList"><li><a href="http://m.php.cn/"><b class="icon1"></b><span>Home</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/course.html"><b class="icon2"></b><span>Course</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/article.html"><b class="icon3"></b><span>Article</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/wenda.html"><b class="icon4"></b><span>Q&A</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/dic.html"><b class="icon6"></b><span>Dictionary</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/course/type/99.html"><b class="icon7"></b><span>Manual</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/xiazai/"><b class="icon8"></b><span>Download</span><div class="clear"></div></a></li><li><a href="http://m.php.cn/faq/zt" title="Topic"><b class="icon12"></b><span>Topic</span><div class="clear"></div></a></li><div class="clear"></div></ul></div></div><div class="nphpDing" style="display: none;"><div class="nphpDinglogo"><a href="http://m.php.cn/"></a></div><div class="nphpNavIn1"><div class="swiper-container nphpNavSwiper1"><div class="swiper-wrapper"><div class="swiper-slide"><a href="http://m.php.cn/" >Home</a></div><div class="swiper-slide"><a href="http://m.php.cn/article.html" class="hover">Article</a></div><div class="swiper-slide"><a href="http://m.php.cn/wenda.html" >Q&A</a></div><div class="swiper-slide"><a href="http://m.php.cn/course.html" >Course</a></div><div class="swiper-slide"><a href="http://m.php.cn/faq/zt" >Topic</a></div><div class="swiper-slide"><a href="http://m.php.cn/xiazai" >Download</a></div><div class="swiper-slide"><a href="http://m.php.cn/game" >Game</a></div><div class="swiper-slide"><a href="http://m.php.cn/dic.html" >Dictionary</a></div><div class="clear"></div></div></div><div class="langadivs" ><a href="javascript:;" class="bg4 bglanguage"></a><div class="langadiv" ><a onclick="javascript:setlang('zh-cn');" class="language course-right-orders chooselan " href="javascript:;"><span>简体中文</span><span>(ZH-CN)</span></a><a onclick="javascript:;" class="language course-right-orders chooselan chooselanguage" href="javascript:;"><span>English</span><span>(EN)</span></a><a onclick="javascript:setlang('zh-tw');" class="language course-right-orders chooselan " href="javascript:;"><span>繁体中文</span><span>(ZH-TW)</span></a><a onclick="javascript:setlang('ja');" class="language course-right-orders chooselan " href="javascript:;"><span>日本語</span><span>(JA)</span></a><a onclick="javascript:setlang('ko');" class="language course-right-orders chooselan " href="javascript:;"><span>한국어</span><span>(KO)</span></a><a onclick="javascript:setlang('ms');" class="language course-right-orders chooselan " href="javascript:;"><span>Melayu</span><span>(MS)</span></a><a onclick="javascript:setlang('fr');" class="language course-right-orders chooselan " href="javascript:;"><span>Français</span><span>(FR)</span></a><a onclick="javascript:setlang('de');" class="language course-right-orders chooselan " href="javascript:;"><span>Deutsch</span><span>(DE)</span></a></div></div><script> var swiper = new Swiper('.nphpNavSwiper1', { slidesPerView : 'auto', observer: true,//修改swiper自己或子元素时,自动初始化swiper observeParents: true,//修改swiper的父元素时,自动初始化swiper }); </script></div></div><!--顶部导航 end--><script>isLogin = 0;</script><script type="text/javascript" src="/static/layui/layui.js"></script><script type="text/javascript" src="/static/js/global.js?4.9.47"></script></div><script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script><link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css' type='text/css' media='all'/><script type='text/javascript' src='/static/js/viewer.min.js?1'></script><script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script><script>jQuery.fn.wait = function (func, times, interval) { var _times = times || -1, //100次 _interval = interval || 20, //20毫秒每次 _self = this, _selector = this.selector, //选择器 _iIntervalID; //定时器id if( this.length ){ //如果已经获取到了,就直接执行函数 func && func.call(this); } else { _iIntervalID = setInterval(function() { if(!_times) { //是0就退出 clearInterval(_iIntervalID); } _times <= 0 || _times--; //如果是正数就 -- _self = $(_selector); //再次选择 if( _self.length ) { //判断是否取到 func && func.call(_self); clearInterval(_iIntervalID); } }, _interval); } return this; } $("table.syntaxhighlighter").wait(function() { $('table.syntaxhighlighter').append("<p class='cnblogs_code_footer'><span class='cnblogs_code_footer_icon'></span></p>"); }); $(document).on("click", ".cnblogs_code_footer",function(){ $(this).parents('table.syntaxhighlighter').css('display','inline-table');$(this).hide(); }); $('.nphpQianCont').viewer({navbar:true,title:false,toolbar:false,movable:false,viewed:function(){$('img').click(function(){$('.viewer-close').trigger('click');});}}); </script></body></html>