生成頭像 沒事寫著玩的

2021-06-10 23:33:49 字數 1297 閱讀 2580

<?php

/** * author: seven yu

* e-mail: dofyyu (at) gmail.com

* version: 0.0.3

* update: 2012/11/14

*/$rand = true;

$cache = true;

$time = $rand ? time() : 0;

$name = isset($_get['name']) ? trim($_get['name']) : $time;

$name = empty($name) ? $time : $name;

$code = isset($_get['code']) ? $_get['code'] : md5($name);

if(preg_match('/^[0-9a-f]$/i', $code) == 0)

$assets = array(

array('name' => 'bg', 'count' => 30),

array('name' => 'face', 'count' => 10),

array('name' => 'eye', 'count' => 11),

array('name' => 'nose', 'count' => 10),

array('name' => 'mouth', 'count' => 10),

array('name' => 'hair', 'count' => 5),

);$folder1 = substr($code, 0, 2);

$folder2 = substr($code, 2, 2);

$folder = "cache/$folder1/$folder2";

$file = "$folder/$code.png";

if(!$cache || !file_exists($file))

}if($cache)

imagepng($im, $file);

}else

imagedestroy($im);

}$cache && header("location:$file");

/** * 單詞 ascii 碼和

* @param $word 字串

* @return 求和

* */

function getwordord($word)

return $result;

}?>

可以在這裡預覽,素材隨便畫的 ╮( ̄▽ ̄")╭ 

寫著玩的小練習

2019年2月20日註 這些 原先發在工作室的 上,時間是2016年9月9日 1 set fso createobject scripting.filesystemobject 2set ws createobject wscript.shell 3onerror resume next4do 5 ...

C 鍊錶 木有用,寫著玩

移除最後乙個的節點 使用二級指標更好 int removefromlast node firstlocation if head next null node current head while current next next null free current next current ne...

乙個寫著玩的 bitcoin 客戶端

看書確實是很好的學習位元幣的方法,但是沒有 的幫助,理解位元幣如何實現時,很是困難。因此,想去閱讀其 實現。在閱讀 bitcoin core 用 c 客戶端時,其環境和除錯對我來說實在麻煩,我看不太懂。後來發現乙個用 js 寫的完整 bitcoin 客戶端,就決定用它來研究位元幣原始碼了,幫助我理解...