9¸ö±ØÐëÖªµÀµÄʵÓÃPHPº¯ÊýºÍ¹¦ÄÜ(2)
2¡¢Ê¹Óà Glob() ²éÕÒÎļþ
Ðí¶à PHP º¯Êý¾ßÓг¤ÃèÊöÐÔµÄÃû³Æ¡£È»¶ø¿ÉÄÜ»áºÜÄÑ˵³ö glob() º¯ÊýÄÜ×öµÄÊÂÇ飬³ý·ÇÄãÒѾͨ¹ý¶à´ÎʹÓò¢ÊìϤÁËËü¡£¿ÉÒÔ°ÑËü¿´×÷ÊÇ±È scandir() º¯Êý¸üÇ¿´óµÄ°æ±¾£¬¿ÉÒÔ°´ÕÕijÖÖģʽËÑË÷Îļþ¡£
ÒÔÏÂΪÒýÓõÄÄÚÈÝ£º // get all php files $files = glob('*.php'); print_r($files); /* output looks like: Array ( [0] => phptest.php [1] => pi.php [2] => post_output.php [3] => test.php ) */
Äã¿ÉÒÔÏñÕâÑù»ñµÃ¶à¸öÎļþ£º
ÒÔÏÂΪÒýÓõÄÄÚÈÝ£º // get all php files AND txt files $files = glob('*.{php,txt}', GLOB_BRACE); print_r($files); /* output looks like: Array ( [0] => phptest.php [1] => pi.php [2] => post_output.php [3] => test.php [4] => log.txt [5] => test.txt ) */Çë×¢Ò⣬ÕâЩÎļþÆäʵÊÇ¿ÉÒÔ·µ»ØÒ»¸ö·¾¶£¬ÕâÈ¡¾öÓÚ²éѯÌõ¼þ£º
ÒÔÏÂΪÒýÓõÄÄÚÈÝ£º $files = glob('../images/a*.jpg'); print_r($files); /* output looks like: Array ( [0] => ../images/apple.jpg [1] => ../images/art.jpg ) */Èç¹ûÄãÏë»ñµÃÿ¸öÎļþµÄÍêÕû·¾¶£¬Äã¿ÉÒÔµ÷Óà realpath() º¯Êý£º
ÒÔÏÂΪÒýÓõÄÄÚÈÝ£º
$files = glob('../images/a*.jpg');
// applies the function to each array element
$files = array_map('realpath',$files);
print_r($files);
/* output looks like:
Array
(
[0] => C:\wamp\www\images\apple.jpg
[1] => C:\wamp\www\images\art.jpg
)
*/
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿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¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ