ÈçºÎÀûÓÃphpÊý×é¶Ô°ÙÍòÊý¾Ý½øÐÐÅÅÖØ
ÔÚƽʱµÄ¹¤×÷ÖУ¬¾³£½Óµ½Òª¶ÔÍøÕ¾µÄ»áÔ±½øÐÐÕ¾ÄÚÐÅ¡¢ÊÖ»ú¶ÌÐÅ¡¢email½øÐÐȺ·¢ÐÅÏ¢µÄ֪ͨ£¬Óû§ÁбíÒ»°ãÓɱðµÄͬÊÂÌṩ£¬µ±ÖÐÄÑÃâ»áÓÐÖØ ¸´£¬ÎªÁ˱ÜÃâÖظ´·¢ËÍ£¬ËùÒÔÎÒÔÚ½øÐз¢ËÍÐÅϢǰҪ¶ÔËûÃÇÌṩµÄÓû§Áбí½øÐÐÅÅÖØ£¬ÏÂÃæÎÒÒÔuidÁбíÀ´½²½²ÎÒÊÇÈçºÎÀûÓÃphpÊý×é½øÐÐÅÅÖصġ£
¼ÙÈçµÃµ½Ò»¸öuidÁÐ±í£¬ÊýÁ¿ÔÚ°ÙÍòÐÐÒÔÉÏ£¬¸ñʽÈçÏ£º
10001000
10001001
10001002
................
10001000
................
10001111
ÆäʵÀûÓÃphpÊý×éµÄÌØÐÔ£¬ºÜºÃ½øÐÐÅÅÖØ£¬ÎÒÃÇÏÈÀ´¿´Ò»ÏÂphpÊý×éµÄ¶¨Ò壺PHP ÖеÄÊý×éʵ¼ÊÉÏÊÇÒ»¸öÓÐÐòÓ³Éä¡£Ó³ÉäÊÇÒ»ÖÖ°Ñ values ¹ØÁªµ½ keys µÄÀàÐÍ¡£´ËÀàÐÍÔںܶ෽Ãæ×öÁËÓÅ»¯£¬Òò´Ë¿ÉÒÔ°ÑËüµ±³ÉÕæÕýµÄÊý×飬»òÁÐ±í£¨ÏòÁ¿£©£¬É¢ÁÐ±í£¨ÊÇÓ³ÉäµÄÒ»ÖÖʵÏÖ£©£¬×ֵ䣬¼¯ºÏ£¬Õ»£¬¶ÓÁÐÒÔ¼°¸ü¶à¿ÉÄÜÐÔ¡£Êý ×éÔªËصÄÖµÒ²¿ÉÒÔÊÇÁíÒ»¸öÊý×é¡£Ê÷ÐνṹºÍ¶àάÊý×éÒ²ÊÇÔÊÐíµÄ¡£
ÔÚphpµÄÊý×éÖУ¬¼ü£¨keys£©Ò²³ÆΪË÷Òý£¬¾ßÓÐΨһÐÔ£¬ÎÒÃÇÕý¿ÉÒÔÀûÓÃÕâÒ»ÌØÐÔ½øÐÐÅÅÖØ£¬Ê¾Àý´úÂëÈçÏ£º
$v) { $content .= $k."\n"; } $fp = fopen('result.txt', 'w'); fwrite($fp, $content); fclose($fp); ?>20¶àÐдúÂ룬¾Í¿ÉÒÔ¶Ô°ÙÍòÒÔÉϵÄÊý¾Ý½øÐÐÅÅÖØ£¬Ð§ÂÊÒ²²»´í£¬·Ç³£ÊµÓá£ÊÖ»úºÅ¡¢email£¬Ò²¿ÉÒÔ²ÉÓÃÕâÖÖ·½Ê½½øÐÐÅÅÖØ¡£
»¹ÓУ¬Õâ¿É·½·¨»¹¿ÉÒÔÓÃÓÚÁ½¸öÎļþ½øÐÐÅÅÖصŤ×÷£¬Èç¹ûÄãÓÐÁ½¸öuidÁбíÎļþ£¬¸ñʽºÍÉÏÃæµÄuidÁбíÒ»Ñù£¬Ê¾Àý³ÌÐòÈçÏ£º
<?php //¶¨ÒåÊý×飬ÓÃÓÚ´æ·ÅÅÅÖغóµÄ½á¹û $result = array(); //¶ÁÈ¡µÚÒ»¸öuidÁбíÎļþ£¬·ÅÈë$result_1 $fp = fopen('test_1.txt', 'r'); while(!feof($fp)) { $uid = fgets($fp); $uid = trim($uid); $uid = trim($uid, "\r"); $uid = trim($uid, "\n"); if($uid == '') { continue; } //ÒÔuidΪkeyдÈë$result£¬ÈçÓÐÖظ´¾Í»á¸²¸Ç $result[$uid] = 1; } fclose($fp); //¶ÁÈ¡µÚ¶þ¸öuidÁбíÎļþ£¬²¢½øÐÐÅÅÖزÙ×÷ $fp = fopen('test_2.txt', 'r'); while(!feof($fp)) { $uid = fgets($fp); $uid = trim($uid); $uid = trim($uid, "\r"); $uid = trim($uid, "\n"); if($uid == '') { continue; } //ÒÔuidΪkeyÈ¥¿´¸ÃÖµÊÇ·ñ´æÔÚ if(empty($result[$uid])) { $result[$uid] = 1; } } fclose($fp); //$resultÀï±£´æµÄ¾ÍÅÅÖØÒÔºóµÄ½á¹û£¬¿ÉÒÔÊä³öµ½Îļþ£¬´úÂëÊ¡ÂÔ ?>
×ÐϸÏëÏ룬²»ÄÑ·¢ÏÖ£¬ÀûÓÃÊý×éµÄÕâÒ»ÌØÐÔ»¹¿ÉÒÔ½â¾öÎÒÃǹ¤×÷Öеĸü¶àÎÊÌâ¡£
By xhttp.cn¡¡ÕûÀí£ºhttp://www.xhttp.cn/2010/05/1
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ