Php funny Avatar puzzles, php Avatar puzzles

Source: Internet
Author: User

Php funny Avatar puzzles, php Avatar puzzles

When studying the GD library of php, I found a piece of code written by others. Here I hope to increase everyone's enthusiasm for php. This code mosaic the person's profile picture, which looks interesting.


function pixelfuck($url, $chars='ewk34543§G§$§$Tg34g4g', $shrpns=1, $size=4,$weight=2){    list($w, $h, $type) = getimagesize($url);    $resource = imagecreatefromstring(file_get_contents($url));    $img = imagecreatetruecolor($w*$size,$h*$size);    $cc = strlen($chars);    for($y=0;$y <$h;$y+=$shrpns)         for($x=0;$x <$w;$x+=$shrpns)            imagestring($img,$weight,$x*$size,$y*$size, $chars{@++$p%$cc}, imagecolorat($resource, $x, $y));    return $img;}$url = 'http://www.bkjia.com/uploads/allimg/140820/0SUV540-0.png';$text = 'I-dont-like-manga-...-Why-do-they-have-such-big-eyes? Strange-...-WHAT-WANT-YOU-DO?';Header('Content-Type: image/png');imagepng(pixelfuck($url, $text, 1, 6));

The following is the original image, and the other is the processed image.









Php display user profile picture Problems

Change first
Echo "<tr> <form action = 'info. php? Id = $ row [imgid] 'method = 'post'> ";
Change 2:
You accept the id you passed in info. php.
Add $ cls = $ _ POST ["id"];
Then pass the id in this way
Echo " ";
Last
$ Img_ SQL = "select image_id, content from nsms_images where image_id = '$ imgid'"; here you can get the Parameter

How to Create a PHP dynamic profile picture/Signature chart?


Php pages are used to randomly generate links to images.
Many image addresses can be placed in an array for random selection.
This is how it works.

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.