PHPÔÓ¼Ç
preg_replace -- Ö´ÐÐÕýÔò±í´ïʽµÄËÑË÷ºÍÌæ»»
array_push -- ½«Ò»¸ö»ò¶à¸öµ¥ÔªÑ¹ÈëÊý×éµÄĩ⣨ÈëÕ»£©
preg_match -- ½øÐÐÕýÔò±í´ïʽƥÅä
exif_imagetype($file) ---ͼÏñÀàÐÍ£»
echo "<SCRIPT LANGUAGE='JavaScript'>alert('µÃµ½');history.back();</SCRIPT>";
exit;
date_default_timezone_set('PRC'); ±±¾©Ê±¼ä£»
bool file_exists ( string filename)
Èç¹ûÓÉ filename Ö¸¶¨µÄÎļþ»òĿ¼´æÔÚÔò·µ»Ø TRUE£¬·ñÔò·µ»Ø FALSE¡£
<?php
$text = "\t\tThese are a few words :) ... ";
echo trim($text); // "These are a few words :) ..."
echo trim($text, " \t."); // "These are a few words :)"
// trim the ASCII control characters at the beginning and end of $binary
// (from 0 to 31 inclusive)
$clean = trim($binary, "\x00..\x1F");
?>
mysql À©Õ¹
<?php if(extension_loaded('mysql')?>
bool is_writable ( string filename)
is_writable -- Åжϸø¶¨µÄÎļþÃûÊÇ·ñ¿Éд
array_values() ·µ»Ø input Êý×éÖÐËùÓеÄÖµ²¢¸øÆ佨Á¢Êý×ÖË÷Òý
$_GETÊý×éÖд«µÝµÄÊÇͨ¹ýurl´«µÝµÄÖµ£¬pageÊÇÊý×éµÄϱê
ÀýÈ磺
http://www.xx.cn/index.php?id=1&page=5
ÄÇô´«µÝ¹ýÀ´µÄ$_GETÊý×éÖÐ
$_GET['id']=1
$_GET['page']=5
globalÊÇÈ«¾Öº¯Êý
$_POST£¬$_GET,ÕâÁ½¸öº¯ÊýÊÇÌá½»±íµ¥Ê±ºòÓõ½
Ö»ÊÇ$_GETÌá½»µÄ¶«Î÷»áÏÔʾÔÚURLÖУ¬¶øÇÒ»áÓÐ×Ö½ÚÏÞÖÆ
$_POSTÌá½»µÄ¶«Î÷²»»áÏÔʾÔÚURLÖУ¬±È½Ï°²È«
section ¼ò½é
section:
sectionµÄ²úÉúÊÇΪ½â¾öforeachµÄ²»×ãµÄ£¬ÓëforeachÒ»Ñù£¬ËüÓÃÓÚÉè¼ÆÄ£°åÄÚµÄÑ»·¿é£¬Ëü½ÏΪ¸´ÔÓ£¬¿É¼«´ó³ÌÐòÉÏÂú×ã³ÌÐòÐèÒª£¬ËùÒÔÔÚ³ÌÐòÖÐÎÒÏ°¹ßʹÓÃËü¶ø²»Ê¹ÓÃforeach,»ù±¾ÔÐÎΪ£º
{section name = name loop = $varName[, start = $start, step = $step, max = $max, show = true]}
name: sectionµÄÃû³Æ£¬²»ÓüÓ$
$loop: Ҫѻ·µÄ±äÁ¿£¬ÔÚ³ÌÐòÖÐҪʹÓÃassign¶ÔÕâ¸ö±äÁ¿½øÐвÙ×÷¡£
$start: ¿ªÊ¼Ñ»·µÄϱ꣬ѻ·Ï±êĬÈÏÓÉ0¿ªÊ¼
$step: ÿ´ÎÑ»·Ê±Ï±êµÄÔöÊý
$max: ×î´óÑ»·Ï±ê
$show: booleanÀàÐÍ£¬¾ö¶¨ÊÇ·ñ¶ÔÕâ¸ö¿é½øÐÐÏÔʾ£¬Ä¬ÈÏΪtrue
ÕâÀïÓиöÃû´ÊÐèҪ˵Ã÷£º
Ñ»·Ï±꣺ʵ¼ÊËüµÄÓ¢ÎÄÃû³ÆΪindex£¬ÊÇË÷Òýµ
Ïà¹ØÎĵµ£º
(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 ......
1.echo();2.print();3.die();4.printf();5.sprintf();6.print_r;7.var_dump();
1.echo()
Êä³ö¶à¸ö×Ö·û´®£¬¿ÉÒÔ¶à¸ö²ÎÊý£¬²»ÐèÒªÔ²À¨ºÅ£¬ÎÞ·µ»ØÖµ¡£
2.print()
Ö»ÄÜÊä³öÒ»Ñù¶«Î÷£¬ÐèÒªÔ²À¨ºÅ£¬Óзµ»ØÖµ£¬Ö´ÐÐʧ°ÜÊÇ·µ»Øflase.
3.die()
Êä³öÄÚÈÝ£¬Í£Ö¹³ÌÐò¡£*¶àÓÃÓÚÊý¾Ý¿âµÄÁ´½Óʱ£¬¼ìÑéÊÇ·ñ³ö´í¡£
4.printf()
prin ......
½ñÌìÔÚ¼ÒÀïÖØа²×°ÁËÒ»ÏÂPHP µ±ÈÃÒ²ÓÐApacheÁË¡£µ«ÊÇÎÒÓöµ½ÁËÒ»¸öÎÊÌ⣬¾ÍÊÇApache·þÎñÎÞ·¨¿ªÆô£¬ºó¹ûÔõÑùÎÒÏëºÜ¶àÈ˶¼ÊÇÖªµÀµÄ£¬µ±Ê±Ò²Ã»ÓжàÏ룬ÒÔΪÊÇ×Ô¼º°²×°µÄʱºò³öÏÖÁËʧÎó¾ÍÖØа²×°Ò»±é£¬¿ÉÊÇ»¹ÊÇÒ»ÑùÎÞ·¨´ò¿ª£¬È»ºóÎÒ¾ÍÔÚÏëÊÇʲôÎÊÌ⣬¶Ë¿ÚºÅ80.ÎҲ鿴ÁËһϣ¬·¢ÏÖûÓдíÎó°¡£¬Ë¼¿¼Á˺ܾ㬶ÔÍøÂçÒÔ¼°·À» ......
×î½üÔÚCSDN¸Õ¿ªÁËÕâ¸ö²©¿Í£¬Ã»Ê²Ã´Ê±¼ä°ÑÒÔǰдµÄÎÄÕ°á¹ýÀ´£¬Ö»ÄÜÓпÕÂýÂýÀ´ÁË¡£
--------------------------ÕâƪÎÄÕ½öÏ׸øÄÇЩһֱÔÚPHPÂÒÂëÎÊÌâÉÏÀ§»óµÄÈË¡£
A.Ê×ÏÈ˵ÏÂHTMLÖÐÎÄÂÒÂëÎÊÌâµÄ½â¾ö·½·¨¡£
±ÈÈçÓиöindex.htmlµÄÒ³Ã棨ÕâÀïÊÇÖ¸ÕæÕýµÄ¾²Ì¬Ò³Ã棬Ð޸ķþÎñÆ÷µÄ……α¾²Ì¬µÄÇë¿´·½°¸B£©
1. ......
µÚÒ»ÖÖ·½·¨£º
<?php
class Access{
function getConn(){
$conn = @new COM("ADODB.Connection") or die ("ADOÁ¬½Óʧ°Ü!");
$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath(__IMP ......