ʹÓÃPHPÅúÁ¿Éú³ÉËæ»úÓû§Ãû
Éú³É6 ~ 16λµÄÓû§ÃûÈô¸É¸ö£¬Ö÷ÒªÊÇÎı¾²Ù×÷£¬µ«ÊÇÇ°ÌáÊÇÒªÓÐÒ»¸ö×Ö·û´®°ü¡£Ö÷Òª°üº¬Èý¸ö³ÌÐò¡£
³ÌÐòÒ»£º¸ºÔð´Ó×ÖµäÖÐËæ»úÌáÈ¡Êý¾Ý£¬Ð´ÈëÒ»¸öÐÂÎļþ¡££¨1.php£©
<?php
/* ´Ó×ÖµäÎļþÖÐÌáÈ¡Ëæ»úÖµ */
$file1 = "./Words.dic";
$file2 = "./common_pass_mini.dic";
$file3 = "./Sys_Month_Date.Dic";
$rfile = "./5.dic";
$n = 2000;
//ÌáÈ¡×Öµä
$basef = file($file1);
$extf = file($file2);
$extf2 = file($file3);
$bf_sum = (count($basef)-1);
$ef_sum = (count($extf)-1);
$ef2_sum =(count($extf2)-1);
//»ñÈ¡Ëæ»úÓû§Ãû
for ($i=0; $i<$n; $i++)
{
$bn = crand(0, $bf_sum);
$en = crand(0, $ef_sum);
$en2 = crand(0, $ef2_sum);
$name = $basef[$bn]."_".$extf[$en];
$name = str_replace("\r\n", "", $name);
$all_name[] = $name;
}
//дÈëÎļþ
$result = implode("\r\n", $all_name);
$fp = fopen($rfile, "a+") or die('Open $rfile failed');
if (fwrite($fp, $result)) {
echo 'Write user succeed!';
} else {
echo 'Write user failed';
}
//Éú³ÉËæ»úÊý×Öº¯Êý
function crand($start, $end)
{
return mt_rand($start, $end);
}
?>
³ÌÐò¶þ£º¸ºÔð°ÑÉÏÃæÉú³ÉµÄÊý¸öÎļþµÄ½á¹ûºÏ²¢¡££¨2.php£©
<?php
/* ºÏ²¢ËùÓÐÉú³É½á¹û knowsky.com*/
$result_file = "./result.dic";
$fp = fopen($result_file, "a+") or die("Open $result_file failed");
//ºÏ²¢ 1.dic ~ 5.dic
for ($i=1; $i<=5; $i++)
{
$cur_file = file_get_contents($i.".dic");
fwrite($fp, $cur_file);
}
//ºÏ²¢ 10.dic ~ 11.dic
for ($i=10; $i<=11; $i++)
{
$cur_file = file_get_contents($i.".dic");
fwrite($fp, $cur_file);
}
fclose($fp);
echo 'Write Succeed';
?>
³ÌÐòÈý£º¸ºÔð¹ýÂËÖظ´ÖµºÍ²»ÊôÓÚ 6~16 Ö®¼äµÄÖµ²¢ÇÒÉú³É×îÖÕ½á¹û£¨3.php£©
<?php
/* Éú³É×îÖÕ½á¹û */
$file = "./result.dic";
$target = "./target.dic";
//È¥µôÖظ´Öµ
$files = file($file);
$files = array_unique($files);
//ÅжÏÖµÊDz»ÊÇ´óÓÚ6λСÓÚ16λ
$sum = count($files);
for ($i=0; $i<$sum; $i++)
{
if (strlen($files[$i])>=6 && strlen($files[$i])<=16) {
$rs[] = $files[$i];
} else {
continue;
}
}
//дÈëÄ¿±êÎļþ
$result = implode("", $rs);
Ïà¹ØÎĵµ£º
°æȨÉùÃ÷£º¿ÉÒÔÈÎÒâתÔØ£¬×ªÔØʱÇëÎñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂÔʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷
http://www.5ilinux.com/lamp01.html
¹Ø¼ü×Ö£ºapache+mysql+php apache mysql php ÅäÖà lamp ·þÎñÆ÷ web
Linux+Apache+Mysql+PHPµäÐÍÅäÖÃ
µ÷ÊÔ»·¾³£ºRedhat9.0 Apache1.3.29 Mysql3.23.58 PHP4.3.4
LinuxϵͳµÄ°²×°ÎҾͲ»½²Á ......
PHPDocumentÊÇ´ÓÄãµÄÔ´´úÂëµÄ×¢ÊÍÖÐÉú³ÉÎĵµ£¬Òò´ËÔÚ¸øÄãµÄ³ÌÐò×ö×¢Ê͵Ĺý³Ì£¬Ò²¾ÍÊÇÄã±àÖÆÎĵµµÄ¹ý³Ì¡£
¡¡¡¡´ÓÕâÒ»µãÉϽ²£¬PHPdoc´ÙʹÄãÒªÑø³ÉÁ¼ºÃµÄ±à³ÌÏ°¹ß£¬¾¡Á¿Ê¹Óù淶£¬ÇåÎúÎÄ×ÖΪÄãµÄ³ÌÐò×ö×¢ÊÍ£¬Í¬Ê±¶à¶àÉÙÉÙÒ²±ÜÃâÁËʺó±àÖÆÎĵµºÍÎĵµµÄ¸üв»Í¬²½µÄһЩÎÊÌâ¡£
¡¡¡¡ÔÚphpdocumentorÖУ¬×¢ÊÍ·ÖΪÎĵµÐÔ×¢ ......
ÒýÓÃÎļþµÄ·½·¨ÓÐ2ÖÖ£º
1¡¢require
require("conn.php"); Ò»°ã·ÅÔÚÒ³ÃæµÄµÚÒ»ÐУ¬×öΪ¸ÃÒ³Ö´ÐеÄÒ»²¿·Ö£¬Ê×ÏÈÖ´ÐÐrequireÄÚµÄconn.php È»ºóÔÙÖ´ÐÐÏÂÃæµÄ´úÂë
2¡¢include
include("header.php");µ±³ÌÐòµ½´ïÕâÀïµÄʱºò²Å»áÖ´ÐÐincludeµÄ header.php ......
Ä¿Ç°Óв»ÉÙAMP£¨Apache\MySQL\PHP£©µÄ¼¯³ÉÈí¼þ£¬¿ÉÒÔÈÃÎÒÃÇÒ»´Î°²×°²¢ÉèÖúá£Õâ¶ÔÓÚ²»ÊìϤAMPµÄÓû§À´Ëµ£¬ºÃ´¦¶à¶à¡£
Ò»¡¢Ê¹ÓÃAMP¼¯³ÉÈí¼þµÄÓŵ㣺
1¡¢¿É±ÜÃâÓÉÓÚȱ·¦AMPµÄ֪ʶ£¬¶øÎÞ·¨ÕýÈ·ÉèÖû·¾³£»
2¡¢¿É¿ìËÙ°²×°²¢ÉèÖúÃAMP»·¾³£¬ÈÃÎÒÃÇÖ±½Ó¿ªÊ¼ÕæÕý¸ÐÐËȤµÄÈí¼þ£¬Èçxoops£»
3¡¢¿É·½±ãµÄ´î½¨²âÊÔ»·¾³£¬¶ÔÓÚ² ......
1.PHP×Ö·û´®²Ù×÷³£Óõķ½·¨
php´®Öл¹ÓÐÒ»¸öÌØÊâµÄ»¨À¨ºÅ²Ù×÷·û¡£µ±ÓÃË«ÒýºÅÖ¸¶¨×Ö·û´®Ê±£¬ÆäÖеıäÁ¿»á±»½âÎö¡£ÔÚË«ÒýºÅÖеĴ®ÖÐÈç¹ûÓöµ½$£¬½âÎöÆ÷»á¾¡¿ÉÄܶàµØÈ¡µÃºóÃæµÄ×Ö·ûÒÔ×é³ÉÒ»¸öºÏ·¨µÄ±äÁ¿Ãû£¬Èç¹ûÏë±íʾָ¶¨Ãû×ֵĽáÊø£¬Óû¨À¨ºÅ°Ñ±äÁ¿ÃûÀ¨ÆðÀ´¡£Çë¿´ÒÔÏ´úÂ룺
<?php
$beer = 'heineke ......