PHPº¯Êý£ºctype_digit
(PHP 4 >= 4.0.4)
¹¦ÄÜ˵Ã÷£ºCheck for numeric character(s)
Description
bool ctype_digit ( string text)
Returns TRUE if every character in text is a decimal digit, FALSE otherwise.
Àý×Ó 1. A ctype_digit() example
<?php $strings = array('1820.20', '10002', 'wsl!12'); foreach ($strings as $testcase) {
if (ctype_digit($testcase)) {
echo "The string $testcase consists of all digits.\n";
} else {
echo "The string $testcase does not consist of all digits.\n";
}
} ?>
This example will output :
The string 1820.20 does not consists of all digits. The string 10002 consists of all digits. The string wsl!12 does not consists of all digits.
PHPº¯Êý£ºctype_xdigit
(PHP 4 >= 4.0.4)
¹¦ÄÜ˵Ã÷£ºCheck for character(s) representing a hexadecimal digit
Description
bool ctype_xdigit ( string text)
Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise.
Àý×Ó 1. A ctype_xdigit() example
<?php $strings = array('AB10BC99', 'AR1012', 'ab12bc99'); foreach ($strings as $testcase) {
if (ctype_xdigit($testcase)) {
echo "The string $testcase consists of all hexadecimal digits.\n";
} else {
echo "The string $testcase does not consist of all hexadecimal digits.\n";
}
} ?>
This example will output :
The string AB10BC99 consists of all hexadecimal digits. The string AR1012 does not consist of all hexadecimal digits. The string ab12bc99 consists of all hexadecimal digits.
ctype_alnum
(PHP 4 >= 4.0.4, PHP 5)
ctype_alnum -- Check for alphanumeric character(s)
˵Ã÷
bool ctype_alnum ( string text )
Checks if all of the characters in the provided string, text, are alphanumeric. In the standard C locale letters are just [A-Za-z] and the function is equivalent to preg_match('/^[a-z0-9]*$/i', $text).
²ÎÊý
text
The tested string.
·µ»ØÖµ
Returns TRUE if
Ïà¹ØÎĵµ£º
sessionÎļþ±£´æÔÚ·þÎñÆ÷£¬¶Ôÿ¸ösession¶¼»áËæ»úÉú³ÉÒ»¸öΨһµÄsessionIdÀ´½øÐбêʶ£¬Ò»°ãÈç¹ûûÓÐÉèÖÃsessionµÄÉú´æÖÜÆÚ£¬Ôòsession»á±£´æÔÚÄÚ´æÖУ¬¹Ø±Õä¯ÀÀÆ÷£¬¸Ãsessionid»á×Ô¶¯×¢Ïú£¬ÖØÐÂÇëÇóʱÔò×Ô¶¯ÖØÐ·ÖÅä¡£
Èç¹û¿Í»§¶ËûÓнûÓÃcookie£¬ÔòÔÚʹÓÃsessionʱ£¬cookie»á°èÑÝ´æ´¢sessionIdºÍsessionÉú´æÖÜÆÚµÄ½ÇÉ«¡£¡ ......
PHP×÷ΪһÖÖ·þÎñÆ÷¶ËµÄ½Å±¾ÓïÑÔ£¬Ïó±àд¼òµ¥£¬»òÕßÊǸ´ÔӵĶ¯Ì¬ÍøÒ³ÕâÑùµÄÈÎÎñ£¬ËüÍêÈ«Äܹ»Ê¤ÈΡ£µ«ÊÂÇé²»×ÜÊÇÈç´Ë£¬ÓÐʱΪÁËʵÏÖij¸ö¹¦ÄÜ£¬±ØÐë½èÖúÓÚ²Ù×÷ϵͳµÄÍⲿ³ÌÐò£¨»òÕß³ÆÖ®ÎªÃüÁ£¬ÕâÑù¿ÉÒÔ×öµ½Ê°빦±¶¡£
¡¡¡¡ÄÇô£¬ÊÇ·ñ¿ÉÒÔÔÚPHP½Å±¾Öе÷ÓÃÍⲿÃüÁîÄØ£¿Èç¹ûÄÜ£¬ÈçºÎÈ¥×öÄØ£¿ÓÐЩʲô·½ÃæµÄ¹ËÂÇÄØ£¿Ïà ......
PHP³ÉΪÊÀ½çÉÏ×îÁ÷ÐеĽű¾ÓïÑÔÓÐÐí¶àÔÒò£ºÁé»îÐÔ£¬Ò×ÓÃÐԵȵȡ£µ«Í¨³£Ö»ÓÃPHP»òÕ߯äËûÓïÑÔ±àÂë¾Í»áÏԵõ¥µ÷¡¢Öظ´£¬Õâʱºò¾ÍÐèÒªÒ»¸öPHP¿ò¼ÜÀ´´úÌæ³ÌÐòÔ±Íê³ÉÄÇÐ©ÖØ¸´²»±äµÄ²¿·Ö¡£±¾ÎÄͨ¹ý»Ø´ðWhat, When, Why ÒÔ¼° WhichÕâЩÎÊÌ⣬½«¶ÔPHP¿ò¼Ü½øÐÐÈ«Ãæ½âÎö¡£
¡¡¡¡PHP¿ò¼ÜÊÇʲô£¿
¡¡¡¡PHP¿ò¼ÜÌṩÁËÒ»¸öÓÃÒÔ¹¹½¨ ......
PHPÖоÓȻûÓжÁÈ¡BMP¸ñʽͼƬµÄº¯Êý,»¹ºÃ¸ßÈËÒѾдºÃÒ»¸ö,ÎÒû¿´´úÂë,·´ÕýÄÜÕý³£Ê¹ÓÃ.
imagecreatefrombmp -- ´Ó BMP Îļþ»ò URL н¨Ò»Í¼Ïñ
function imagecreatefrombmp($file)
{
global $CurrentBit, $echoMode;
$f=fopen($file,"r");
$Header=fread($f,2);
if($Header=="BM" ......