Because I log on several times and the connection speed is very slow, I gave up. Of course, there are too many message plug-ins. For example, it's a bit of a hot talk now, but it's still a problem for friends who haven't registered many words. For more social account binding, I have tested many times, QQ, and Renren. Binding to mainstream platforms often fails, and some friends (like me) hate tedious authorization.
In view of this, I am thinking of a popular and simple method. I think of a friend who does not have a profile picture to call his QQ profile picture. Because QQ now has at least one person, I only need to enter the QQ number when leaving a message and then call his profile picture. This makes it much easier.
The first step is to get the avatar of QQ, which is also the first step of this idea, that is, today's topic:
Method 1:
| The code is as follows: |
Copy code |
<? Php $ Qq = 552452006; Echo ' '; ?> |
Method 2:
| The code is as follows: |
Copy code |
<? Php $ Qq = 552452006; $ 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 first method is that the source image of the avatar can be output. If your avatar is a dynamic gif, the output is also a dynamic image. The disadvantage is that it is slow and is not suitable for calling avatar.
The advantage of the second method is that it is faster than the first method, but it only captures the static graph of the Avatar and does not display the dynamic avatar. It is more suitable for calling the Avatar method.