php³£Óü¼ÇÉ
ÈçºÎÅжÏipµØÖ·ºÏ·¨ÐÔ
if(!strcmp(long2ip(sprintf("%u",ip2long($ip))),$ip)) echo "is ipn";
emailµÄÕýÔòÅжÏ
eregi("^[_.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z_-]+.)+[a-zA-Z]$", $email);
¼ì²âipµØÖ·ºÍmaskÊÇ·ñºÏ·¨µÄÀý×Ó
$ip = '192.168.0.84';
$mask = '255.255.255.0';
$network = '192.168.0';
$ip = ip2long($ip);
$mask = ip2long($mask);
$network = ip2long($network);
if( ($ip & $mask) == $network) echo "valid ip and maskn";
?>
ÎļþÏÂÔØÍ·²¿Êä³öÈçºÎÉ趨
header("Content-type: application/x-download");
header("Content-Disposition: attachment; filename=$file_download_name;");
header("Accept-Ranges: bytes");
header("Content-Length: $download_size");
echo 'xxx'
ÓÃheaderÊä³öftpÏÂÔØ·½Ê½,²¢ÇÒÖ§³Ö¶ÏµãÐø´«
Ò»¸öÀý×Ó:
header('Pragma: public');
header('Cache-Control: private');
header('Cache-Control: no-cache, must-revalidate');
header('Accept-Ranges: bytes');
header('Connection: close');
header("Content-Type: audio/mpeg");
header("Location:ftp://download:1bk3l4s3k9s2@232.2.22.22/2222/web¼¼Êõ¿ª·¢ÖªÊ¶¿â/cn_web.rmvb");
ÕýÔòÆ¥ÅäÖÐÎÄ
ereg("^[".chr(0xa1)."-".chr(0xff)."]+$", $str);
ÅúÁ¿Ìæ»»Îı¾ÀïÃæµÄ³¬¼¶Á´½Ó
<?php
function urlParse($str = ''){
if ('' == $str) return $str;
$types = array("http", "ftp", "https");
$replace = <<<EOPHP
'<a href="'.htmlentities('\1').htmlentities('\2').'">'.htmlentities('\1').htmlentities('\2').'</a>'
EOPHP;
$ret = $str;
while(list(,$type) = each($types)){
$ret = preg_replace("|($type://)([^\s]*)|ie ", $replace, $ret);
}
return $ret;
}
?>
Ïà¹ØÎĵµ£º
IISÉϰ²×°PHP5.3µÄÍêÕû½Ì³Ì·½·¨(¼°5.3.0ÒÔºó°æ±¾µÄ·½·¨)
ÓÉÓÚPHP5.3µÄÈ«ÐÂÌØÐ§¼°¸Ä½ø£¬ÔÓеÄisapi·½Ê½½âÎöPHP
½Å±¾ÒѾ²»±»Ö§³Ö£¬PHP´Ó5.3
.0ÒÔºóµÄ°æ±¾¿ªÊ¼Ê¹ÓÃ΢ÈíµÄfastcgiģʽ£¬ÕâÊÇÒ»¸ö¸üÏȽøµÄ·½Ê½£¬ÔËÐÐËٶȸü¿ì£¬¸üÎȶ¨£¡
а汾
µÄPHP5.3ͨ¹ýÒÔÍùÀÏ·½·¨ÒѾ²»ÄÜÔÚIISÉϰ²×°ÁË£¬ÏÖÔÚ¸ø³öÔÚIISÉϰ²×°PHP5.3ÒÔº ......
phpÖÐsubstrµÄÓ÷¨Ïê½â
php.netÖйØÓÚsubstrµÄ˵Ã÷ºÜ¼òµ¥:
start
If start is non-negative, the returned string will start at the start 'th position in string , counting from zero. For instance, in the string 'abcdef', the character at position 0 is 'a', the character at position 2 is 'c', and so for ......
ÔÚÍøÕ¾Éè¼ÆÖÐÎÒÃǾ³£»áÓöµ½ÐèÒª¶àÓïÑÔÖ§³ÖµÄÇé¿ö¡£¶àÓïÑÔϵͳ°´ÕÕÖ§³ÖµÄ·½Ê½Ò»°ã¿É·ÖΪÁ½ÖÖ£º
1.Ö§³Ö¶àÓïÑÔ£¬µ«²»Ö§³Ö¶àÖÖÓïÑÔµÄͬʱ´æÔÚ£¬Ò²¾ÍÊÇ˵ҪôÊÇÖÐÎÄҪôÊÇÓ¢ÎÄ»òÕ߯äËû£¬ÕâÔÚһЩÐèÒª¹ú¼Ê»¯Ö§³ÖµÄÍøÒ³ÏµÍ³Öо³£ÓÃÀ´£¬ÒԱ㷽±ãÓû§±¾µØ»¯¡£ 2.Ö§³Ö¶àÓïÑÔ²¢¿Éͬʱä¯ÀÀ²»Í¬ÓïÑÔ°æ±¾µÄÍøÒ³¡£½ñÌìÎÒÏëÌÖ ......
Ëæ ×ÅÍøÕ¾·ÃÎÊÁ¿µÄ¼Ó´ó£¬Ã¿´Î´ÓÊý¾Ý¿â¶ÁÈ¡¶¼ÊÇÒÔЧÂÊ×÷Ϊ´ú¼ÛµÄ£¬ºÜ¶àÓÃACCESS×÷Êý¾Ý¿âµÄ¸ü»áÉîÓÐÌå»á£¬¾²Ì¬Ò³¼ÓÔÚËÑË÷ʱ£¬Ò²»á±»ÓÅÏÈ¿¼ÂÇ¡£»¥ÁªÍøÉÏÁ÷ ÐеÄ×ö·¨Êǽ«Êý¾ÝÔ´´úÂëдÈëÊý¾Ý¿âÔÙ´ÓÊý¾Ý¿â¶ÁÈ¡Éú³É¾²Ì¬Ã棬ÕâÑùÎÞÐμä¾Í¼Ó´óÁËÊý¾Ý¿â¡£½«ÏÖÓеÄASPÒ³Ö±½ÓÉú³É¾²Ì¬Ò³£¬½«»á½ÚÊ¡ºÜ¶à¡£
ÏÂÃæµÄÀý×ÓÊǽ«¡¢index.asp?i ......
1.²úÉúËæ»ú×Ö·û´®º¯Êý
function random($length) {
$hash = '';
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
$max = strlen($chars) - 1;
mt_srand((double)microtime() * 1000000);
for($i = 0; $i < $length; $i++) {
$ha ......