Use PHP to get the QQ avatar two ways to share.
Method One:
<?php
$qq =12345678;
Echo ' ';
Method Two:
<?php
$qq =12345678;
$SRC = ' http://q1.qlogo.cn/g?b=qq&nk= '. $qq. ' &s=100&t= '. Time ();
Header (' content-type:image/png ');
$res =imagecreatefromstring (file_get_contents ($SRC));
Imagepng ($res);
Imagedestroy ($res);
The difference between the two methods:
The advantage of the method is that the original image can be output, if your avatar is a dynamic gif, then the output is also a dynamic diagram. The disadvantage is that the speed is slow, not suitable as a way to call the avatar.
Method Two advantage is compared with the first speed is relatively fast, but only grasp the head of the static diagram, will not display dynamic avatar, more suitable as a way to call the avatar.
Articles that you may be interested in
- PHP in front of quotes to add the reason for the backslash and PHP to remove the backslash, three ways to turn off the PHP magic quotes
- PHP with header () implementation file download, download the file hint is broken can not open the solution
- PHP get today tomorrow yesterday timestamp of the N-way summary
- PHP empty (delete) files in the specified directory, do not delete the Directory folder method
- PHP implementation of the same server with multiple two-level domain share session data
- PHP Analysis file header information to determine the type of upload file
- Three ways to get a client's real IP address from PHP
- How PHP clears HTML formatting and removes spaces from text and then intercepts text