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.