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 ......
½ñÌìÓÖͻȻ·¢ÏÖÁËÒ»¸ö¼¼ÇÉ£¬¾ÍÊÇPHP¿ÉÒÔ´«Öµ¸øjs£¬ÈçºÎ×öÄØ£¿
ÔÀ´PHPµÄÔÀíÊÇÕâÑùµÄ£º
PHPµÄËùÓÐÓ¦ÓóÌÐò¶¼ÊÇͨ¹ýWEB·þÎñÆ÷(ÈçIIS»òApache)ºÍPHPÒýÇæ³ÌÐò½âÊÍÖ´ÐÐÍê³ÉµÄ£¬¹¤×÷¹ý³Ì£º
(1)µ±Óû§ÔÚä¯ÀÀÆ÷µØÖ·ÖÐÊäÈëÒª·ÃÎʵÄPHPÒ³ÃæÎļþÃû£¬È»ºó»Ø³µ¾Í»á´¥·¢Õâ¸öPHPÇëÇ󣬲¢½«ÇëÇó´«ËÍ»¯Ö§³ÖPHPµÄWEB·þÎñÆ÷¡£
(2)WEB·þÎñÆ ......
1.ÀàºÍ¶ÔÏó¡£
ÀàÊÇÒ»ÀàÊÂÎïµÄÃèÊö¡£³éÏ󣬸ÅÄîÉϵ͍Òå¡£
¶ÔÏóÊÇʵ¼Ê´æÔÚµÄÿ¸ö¸öÌå¡£Ò²½ÐʵÀý¡£¶ÔÏóÊÇnew³öÀ´µÄ¡£$p = new Person();
2.ÊôÐÔ
ÓÃÀ´ÃèÊöÀàÖеÄÊý¾ÝÔªËØ¡££¨Ò²½ÐÊý¾Ý/״̬£©
ÐÞÊηû£¨PHP5ÖбØÐëÐÞÊΣ©:public(¹«¿ª,ÀàµÄÄÚÍⲿ¶ÁÈ¡ÐÞ¸Ä),private(˽ÓÐÖ»ÔÚµ±Ç°ÀàÖжÁÈ¡ÐÞ¸Ä),protected(±£»¤,ÄÜÔÚÕâ¸öÀàºÍ ......
function redirect($url, $msg)
{
echo $msg."</br>\n";
echo "<a href=\"".$url."\">Èç¹ûûÓÐÌø×ª£¬ÇëµãÕâÀïÌø×ª</a>\n";
echo "<script language=\"javascript\">se ......
<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@ËÎÌå" ......