PHP Éú³ÉËæ»úÊý
function randomkeys($length)
{
$key='';
$pattern='123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
for($i=0;$i<$length;$i++)
{
$key .= $pattern{mt_rand(0,47)};
}
return $key;
}
echo randomkeys(20);
Ïà¹ØÎĵµ£º
Ò»¡¢ÈçºÎÑ¡Ôñ PHP5.3 µÄ VC9 °æ±¾ºÍ VC6 °æ±¾
VC6 °æ±¾ÊÇʹÓà Visual Studio 6 ±àÒëÆ÷±àÒëµÄ£¬Èç¹ûÄãµÄ PHP ÊÇÓà Apache À´¼ÜÉèµÄ£¬ÄÇÄã¾ÍÑ¡Ôñ VC6 °æ±¾¡£
VC9 °æ±¾ÊÇʹÓà Visual Studio 2008 ±àÒëÆ÷±àÒëµÄ£¬Èç¹ûÄãµÄ PHP ÊÇÓà IIS À´¼ÜÉèµÄ£¬ÄÇÄã¾ÍÑ¡Ôñ VC9 °æ±¾¡£
¶þ¡¢ÈçºÎÑ¡Ôñ PHP5.3 µÄ Thread Safe ºÍ Non Thread S ......
Ò»¡¢ ÒýÑÔ
¡¡¡¡PHPÊÇÒ»ÖÖÁ¦Á¿Ç¿´óµ«Ï൱ÈÝÒ×ѧϰµÄ·þÎñÆ÷¶Ë½Å±¾ÓïÑÔ£¬¼´Ê¹ÊǾÑé²»¶àµÄ³ÌÐòÔ±Ò²Äܹ»Ê¹ÓÃËüÀ´´´½¨¸´ÔӵĶ¯Ì¬µÄwebÕ¾µã¡£È»¶ø£¬ËüÔÚʵÏÖÒòÌØÍø·þÎñµÄÃØÃܺͰ²È«·½ÃæÈ´³£³£´æÔÚÐí¶àÀ§ÄÑ¡£ÔÚ±¾ÏµÁÐÎÄÕÂÖУ¬ÎÒÃǽ«Ïò¶ÁÕß½éÉܽøÐÐweb¿ª·¢Ëù±ØÐèµÄ°²È«±³¾°ÒÔ¼°PHPÌض¨µÄ֪ʶºÍ´úÂë-Äã¿ÉÒÔ½èÒÔ±£»¤Äã×Ô¼ºµÄwebÓ¦Óó ......
<?php
/* ----------------------------------------------------------------------------
* Script Name: encrypt.php
* Creation Date: 2008-4-7 10:36
* Last Modified: 2008-4-12 16:00
* Author: meyu
* Copyright (c) 2007
* Purpose: Êý×Ö×Ö·û´®¼òÒ×¼Ó½âÃÜ
* --------------------------------- ......
·¢ÐÅÈË: feuvan ( }><(([@> ~ ), ÐÅÇø: PHP
±ê Ìâ: [ÈëÃÅ]Óà PHP ¶ÁÈ¡ÎļþµÄÕýÈ··½·¨
·¢ÐÅÕ¾: ˮľÉçÇø (Wed Mar 7 17:51:58 2007), Õ¾ÄÚ
http://www.ibm.com/developerworks/cn/opensource/os-php-re ......