phpɾ³ýÎļþºÍÕû¸öÎļþ¼Ð
function delfile($dir)
{
if (is_dir($dir))
{
$dh=opendir($dir);
while (false !== ( $file = readdir ($dh)))
{
if($file!="." && $file!="..")
{
$fullpath=$dir."/".$file;
if(!is_dir($fullpath))
{
unlink($fullpath);
}
else
{
delfile($fullpath);
}
}
}
closedir($dh);
}
}
function deldir($dir)
{
delfile($dir);
if (is_dir($dir))
{
rmdir($dir); //dir must be empty
}
return true;
}
Ïà¹ØÎĵµ£º
½â¾öµÄ°ì·¨Óкü¸¸ö£º
µÚÒ»¸öÊÇ£ºstr_split()£¬Õâ¸ö·½·¨ÊÇPHP5¼ÓÈëµÄ¡£
<?php
$str = "Hello Friend";
$arr1 = str_split($str);
$arr2 = str_split($str, 3);
print_r($arr1);
print_r($arr2);
?>
Êä³ö¾ÍÊÇ£º
Array
(
[0] => H
[1] => e
[2] => l
[3] => l
......
1.Èç¹ûÒ»¸ö·½·¨¿É¾²Ì¬»¯£¬¾Í¶ÔËü×ö¾²Ì¬ÉùÃ÷¡£ËÙÂÊ¿ÉÌáÉýÖÁ4±¶¡£
2.echo ±È print ¿ì¡£
3.ʹÓÃechoµÄ¶àÖزÎÊý£¨Òë×¢£ºÖ¸ÓöººÅ¶ø²»ÊǾäµã£©´úÌæ×Ö·û´®Á¬½Ó¡£
4.ÔÚÖ´ÐÐforÑ»·Ö®Ç°È·¶¨×î´óÑ»·Êý£¬²»ÒªÃ¿Ñ»·Ò»´Î¶¼¼ÆËã×î´óÖµ¡£
5.×¢ÏúÄÇЩ²»ÓõıäÁ¿ÓÈÆäÊÇ´óÊý×飬ÒÔ±ãÊÍ·ÅÄÚ´æ¡£
6.¾¡Á¿±ÜÃâʹÓÃ__get£¬__se ......
×öPHP³ÌÐòµÄÈ˶¼ÖªµÀhtmlentitiesºÍhtmlspecialcharsº¯Êý£¬¶¼ÊǸñʽ»¯html´úÂëµÄ£¬µ«ÊÇÕâ¶þ¸öº¯ÊýÊÇ·ñÕæµÄ¹¦ÄÜÒ»ÑùÂ𣿠php³ÌÐòÔ±Ö®¼Ò ÕâÁ½¸öº¯ÊýÔÚ¸ñʽ»¯´øÓÐÓ¢ÎÄ×Ö·ûµÄhtml´úÂëµÄʱºò»ù±¾Ã»É¶ÎÊÌ⣬µ«ÊÇhtmlentities¶ÔÖÐÎÄ×Ö·ûÒ²²»·Å¹ý£¬ÕâÑùµÃ³öÀ´µÄ½á¹ûÊÇÖÐÎÄ×Ö·û²¿·Ö±äΪһ¶ÑÂÒÂë¡£µ±Ê±×öÓ¢ÎÄÕ¾µÄʱºò¸ù±¾¾Íû¾õ²ìµ ......
set_magic_quotes_runtimeÊÇÓÃÀ´ÉèÖÃPHP »·¾³ÅäÖõıäÁ¿ magic_quotes_runtime Öµ¡£
0-¹Ø±Õ 1-´ò¿ª
³ÌÐòÖмì²â״̬ÓÃget_magic_quotes_runtime,·µ»Ø 0 ±íʾ¹Ø±Õ±¾¹¦ÄÜ£»·µ»Ø 1 ±íʾ±¾¹¦ÄÜ´ò¿ª¡£Èô
magic_quotes_runtime ´ò¿ªÊ±£¬ËùÓÐÍⲿÒýÈëµÄÊý¾Ý¿â×ÊÁÏ»òÕßÎļþµÈµÈ¶¼»á×Ô¶¯×ªÎªº¬Óз´Ð±ÏßÒç³ö×Ö·ûµÄ×ÊÁÏ¡ ......
<?php
/**
* @author wyt
*
*/
class zip {
private $_zipObj=null;
private $_zipfcArr=array();
private $_basePath=null;
private $_zipName;
/**
* init
* @param zipÎļþÃû³Æ $zipName
*/
function __construct($zipName){
$this->_zipName=$zipName;
$this->_zipObj= ......