Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

¡¾PHPϵÁн̡̳¿(5)——PHPµÄ³£Á¿

¡¾PHPϵÁн̡̳¿(4)½²ÊöÁËPHPµÄ±äÁ¿£ºhttp://blog.csdn.net/rocket5725/archive/2010/01/08/5159704.aspx
±¾½ÚÖ÷Òª½éÉÜPHPÖеij£Á¿£¬Ö÷Òª°üÀ¨ÆäÓï·¨ºÍÔ¤¶¨Òå³£Á¿µÄ½éÉÜ¡£
³£Á¿ÊÇÒ»¸ö¼òµ¥ÖµµÄ±êʶ·û£¨Ãû×Ö£©¡£ÈçͬÆäÃû³ÆËù°µÊ¾µÄ£¬Ôڽű¾Ö´ÐÐÆÚ¼ä¸ÃÖµ²»Äܸı䣨³ýÁËËùνµÄħÊõ³£Á¿£¬ËüÃÇÆäʵ²»Êdz£Á¿£©¡£³£Á¿Ä¬ÈÏΪ´óСдÃô¸Ð¡£°´ÕÕ¹ßÀý³£Á¿±êʶ·û×ÜÊÇ´óдµÄ¡£
³£Á¿ÃûºÍÆäËüÈκΠPHP ±êÇ©×ñѭͬÑùµÄÃüÃû¹æÔò¡£ºÏ·¨µÄ³£Á¿ÃûÒÔ×Öĸ»òÏ»®Ïß¿ªÊ¼£¬ºóÃæ¸ú×ÅÈκÎ×Öĸ£¬Êý×Ö»òÏ»®Ïß¡£ÓÃÕýÔò±í´ïʽÊÇÕâÑù±í´ïµÄ£º[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*
×¢: ÔÚÕâÀ×ÖĸÊÇ a-z£¬A-Z£¬ÒÔ¼°´Ó 127 µ½ 255£¨0x7f-0xff£©µÄ ASCII ×Ö·û¡£
ºÍ superglobals Ò»Ñù£¬³£Á¿µÄ·¶Î§ÊÇÈ«¾ÖµÄ¡£²»ÓùÜ×÷ÓÃÓò¾Í¿ÉÒÔÔڽű¾µÄÈκεط½·ÃÎʳ£Á¿¡£
Ò»¡¢Óï·¨
¿ÉÒÔÓà define() º¯ÊýÀ´¶¨Òå³£Á¿¡£Ò»¸ö³£Á¿Ò»µ©±»¶¨Ò壬¾Í²»ÄÜÔٸıä»òÕßÈ¡Ïû¶¨Òå¡£
³£Á¿Ö»ÄÜ°üº¬±êÁ¿Êý¾Ý£¨boolean£¬integer£¬float ºÍ string£©¡£
¿ÉÒÔ¼òµ¥µÄͨ¹ýÖ¸¶¨ÆäÃû×ÖÀ´È¡µÃ³£Á¿µÄÖµ£¬²»ÒªÔÚ³£Á¿Ç°Ãæ¼ÓÉÏ $ ·ûºÅ¡£Èç¹û³£Á¿ÃûÊǶ¯Ì¬µÄ£¬Ò²¿ÉÒÔÓú¯Êý constant() À´¶ÁÈ¡³£Á¿µÄÖµ¡£Óà get_defined_constants() ¿ÉÒÔ»ñµÃËùÓÐÒѶ¨ÒåµÄ³£Á¿ÁÐ±í¡£
×¢: ³£Á¿ºÍ£¨È«¾Ö£©±äÁ¿ÔÚ²»Í¬µÄÃû×Ö¿Õ¼äÖС£ÕâÒâζ×ÅÀýÈç TRUE ºÍ $TRUE ÊDz»Í¬µÄ¡£
Èç¹ûʹÓÃÁËÒ»¸ö䶨ÒåµÄ³£Á¿£¬PHP ¼Ù¶¨ÄãÏëÒªµÄÊǸó£Á¿±¾ÉíµÄÃû×Ö£¬ÈçͬÄãÓÃ×Ö·û´®µ÷ÓÃËüÒ»Ñù£¨CONSTANT ¶ÔÓ¦ "CONSTANT"£©¡£´Ëʱ½«·¢³öÒ»¸ö E_NOTICE ¼¶µÄ´íÎ󡣲μûÊÖ²áÖÐΪʲô $foo[bar] ÊÇ´íÎóµÄ£¨³ý·ÇÄãÊÂÏÈÓà define() ½« bar ¶¨ÒåΪһ¸ö³£Á¿£©¡£Èç¹ûÄãÖ»Ïë¼ì²éÊÇ·ñ¶¨ÒåÁËij³£Á¿£¬Óà defined() º¯Êý¡£
³£Á¿ºÍ±äÁ¿²»Í¬£º
1¡¢³£Á¿Ç°ÃæûÓÐÃÀÔª·ûºÅ£¨$£©£»
2¡¢³£Á¿Ö»ÄÜÓà define() º¯Êý¶¨Ò壬¶ø²»ÄÜͨ¹ý¸³ÖµÓï¾ä£»
3¡¢³£Á¿¿ÉÒÔ²»ÓÃÀí»á±äÁ¿·¶Î§µÄ¹æÔò¶øÔÚÈκεط½¶¨ÒåºÍ·ÃÎÊ£»
4¡¢³£Á¿Ò»µ©¶¨Òå¾Í²»Äܱ»ÖØж¨Òå»òÕßÈ¡Ïû¶¨Ò壻
5¡¢³£Á¿µÄÖµÖ»ÄÜÊDZêÁ¿¡£
´úÂë1£º¶¨Òå³£Á¿
<?php
define("CONSTANT", "Hello world.");
echo CONSTANT; // outputs "Hello world."
echo Constant; // outputs "Constant" and issues a notice.
?>
¶þ¡¢Ô¤¶¨Òå³£Á¿
PHP ÏòËüÔËÐеÄÈκνű¾ÌṩÁË´óÁ¿µÄÔ¤¶¨Òå³£Á¿¡£²»¹ýºÜ¶à³£Á¿¶¼ÊÇÓɲ»Í¬µÄÀ©Õ¹¿â¶¨ÒåµÄ£¬Ö»ÓÐÔÚ¼ÓÔØÁËÕâЩÀ©Õ¹¿âʱ²Å»á³öÏÖ£¬»òÕ߶¯Ì¬¼ÓÔغ󣬻òÕßÔÚ±àÒëʱÒѾ­°üÀ¨½øÈ¥ÁË¡£
ÓÐËĸöħÊõ³£


Ïà¹ØÎĵµ£º

php»ñÈ¡xmlÊôÐÔÖµ

<!-- xml¸ñʽ
<foo xmlns="test">
<bar attr='a'></bar>
<bar attr='b'></bar>
<bar attr='c'></bar>
</foo>
-->
<?php
$dom = new DOMDocument();
if (!$dom->load('attr.xml'))
{
echo "load books.xml failed!<br>";
re ......

phpѧϰ±Ê¼Ç£¨13£©:PHP+MYSQL¼òµ¥·ÖÒ³

conn.php
<?php
/*
 * Created on 2010-1-6
 * Author:CHAUVET
 * Function:Á¬½Ó×Ö·û´®
 */
 $conn=@mysql_connect("localhost","root","")or die("Á¬½ÓÊý¾Ý¿â³ö´í£¡");
 mysql_select_db("newdb",$conn);
 mysql_query("set names 'gb2312'");
 function ReplaceSom ......

Phpѧϰ±Ê¼Ç

·¢±íÓÚ2008Äê10ÔÂ14ÈÕ
PHP»ù´¡£º±êǩʹÓãº
PHP´úÂë±ØÐë°üº¬ÔÚ <?PHP ºÍ ?>Ö®¼ä¡£
һЩÆäËûµÄ±êÇ©ÑùʽҲ¿ÉÒÔʹÓ㬱ÈÈç<?,<%,»òÕß<script  language="php">(Js±êÇ©)¡£
ÆäËû±êÇ©¿ÉÒÔÊÇÓ㬵«Ö»ÓÐÔÚ<?php £¿>Ö®¼äµÄ½Å±¾²ÅÊÇ¿ÉÓõÄPHP´úÂë¡£
£¨¹ØÓÚlesson 23 µÄphp.iniÅäÖÃÎļþ£©
¿ªÊ ......

ÕýÔò±í´ïʽÔÚphp£¬java£¬javascriptÖзֱðÓ¦ÓÃ

ÔÚjavascriptÖÐÓ÷¨¾ÙÀý
var rule = /^\d+$/;
if(!rule.test(addform.rmb_price.value)) {
alert('rmb_price must be number');
addform.rmb_price.focus();
return false;
}
ÔÚphpÖÐÓ÷¨¾ÙÀý
$aa = "/^\d+$/";
if(preg_match($aa, "111")) {
echo "found";
}
ÔÚjavaÖÐÓ÷¨¾ÙÀý ......

ÓÃPHP¿ªÊ¼ÄãµÄMVC(Èý)ʵÏÖÄãµÄModel²ã ÊÕ²Ø


http://blog.csdn.net/hahawen/archive/2004/05/01/20692.aspx
Èý¡¢ÊµÏÖÄãµÄMode²ã
Model²ã£¬¾ÍÊÇMVCģʽÖеÄÊý¾Ý´¦Àí²ã£¬ÓÃÀ´½øÐÐÊý¾ÝºÍÉÌÒµÂß¼­µÄ×°·â£¬½øÐÐËûµÄÉè¼ÆµÄʱºòÉè¼Æµ½Èý¸ö¸ö¸ÅÄî:
------ModelÀà¡£ÊÇʵÌåÀà¡£ÓÃÀ´±£´æÊý¾Ý¿â±í¸ñµÄÖÐÒ»Ìõ¼Ç¼µÄËùÓÐ×ֶεÄÊý¾Ý¡£²¢ÇÒ¿ÉÒÔÑéÖ¤ÕâÌõ¼Ç¼Êý¾ÝµÄÍêÕûÐÔ¡£
------ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ