phpÃæÊÔÌâÄ¿(ÒÑ×¢´ð°¸)
¼òÊöÌâ(50·Ö)()
1¡¢ÓÃPHP´òÓ¡³öÇ°Ò»ÌìµÄʱ¼ä¸ñʽÊÇ2006-5-10 22:21:21(2·Ö)
echo date('Y-m-d H:i:s', strtotime('-1 day'));
»òÕß
$yesterday = time() - (24 * 60 * 60);
echo 'today:'.date('Y-m-d H:i:s')."\n";
echo 'yesterday:'. date('Y-m-d H:i:s', $yesterday)."\n";
2¡¢echo(),print(),print_r()µÄÇø±ð(3·Ö)
echoÊÇPHPÓï¾ä, printºÍprint_rÊǺ¯Êý,Óï¾äûÓзµ»ØÖµ,º¯Êý¿ÉÒÔÓзµ»ØÖµ(¼´±ãûÓÐÓÃ)
printÖ»ÄÜ´òÓ¡³ö¼òµ¥ÀàÐͱäÁ¿µÄÖµ(Èçint,string)
print_r¿ÉÒÔ´òÓ¡³ö¸´ÔÓÀàÐͱäÁ¿µÄÖµ(ÈçÊý×é,¶ÔÏó)
echo -- Êä³öÒ»¸ö»òÕ߶à¸ö×Ö·û´®
3¡¢Äܹ»Ê¹HTMLºÍPHP·ÖÀ뿪ʹÓõÄÄ£°å(1·Ö)
smarty£¬Heyes Template ClassµÈ
5¡¢Ê¹ÓÃÄÄЩ¹¤¾ß½øÐа汾¿ØÖÆ£¿(1·Ö)
CVSºÍSVN,SVNºÅ³ÆÏÂÒ»´úCVS,¹¦ÄÜÇ¿´ó,²»¹ýCVSÊÇÀÏÅÆ,ÊÐÕ¼Âʺܸß.ÎÒÒ»Ö±ÓÃSVN,ÌâÄ¿ÊÇÎÊÓÃʲô¹¤¾ßßÀ,Õâ¸ö¿ÉÄÜÐèÒªÕâô»Ø
´ð:CVS Server on Apache×÷·þÎñ¶Ë,WinCVS×÷¿Í»§¶Ë;Subversion on Apache/DAV
×ö·þÎñ¶Ë,TortoiseSVN×ö¿Í»§¶Ë,»òÕßSubclipse×ö¿Í»§¶Ë.
6¡¢ÈçºÎʵÏÖ×Ö·û´®·×ª£¿(3·Ö)
strrev()
»òÕß
$str = "abcdefg";
function strrevv($str)
{
$len=strlen($str);
$newstr = '';
for($i=$len;$i>=0;$i--)
{
$newstr .= $str{$i};
}
return $newstr;
}
$showstr = strrevv($str);
echo $showstr."<br>";
---------------------------------------------------------------
7¡¢ÓÅ»¯MYSQLÊý¾Ý¿âµÄ·½·¨¡£(4·Ö£¬¶àд¶àµÃ)
(1).Ñ¡È¡×îÊÊÓõÄ×Ö¶ÎÊôÐÔ,Ó¦¸Ã¾¡Á¿°Ñ×Ö¶ÎÉèÖÃΪNOT NULL£¬ÕâÑùÔÚ½«À´Ö´ÐвéѯµÄʱºò£¬Êý¾Ý¿â²»ÓÃÈ¥±È½ÏNULLÖµ¡£
(2).ʹÓÃÁ¬½Ó£¨JOIN£©À´´úÌæ×Ó²éѯ(Sub-Queries)
(3).ʹÓÃÁªºÏ(UNION)À´´úÌæÊÖ¶¯´´½¨µÄÁÙʱ±í
(4).¾¡Á¿ÉÙʹÓà LIKE ¹Ø¼ü×ÖºÍͨÅä·û
(5).ʹÓÃÊÂÎñºÍÍâ¼ü
»òÕß
(1).Êý¾Ý¿âÉè¼Æ·½Ãæ,ÕâÊÇDBAºÍArchitectµÄÔðÈÎ,Éè¼Æ½á¹¹Á¼ºÃµÄÊý¾Ý¿â,±ØÒªµÄʱºò,È¥Õý¹æ»¯(Ó¢ÎÄÊÇÕâ¸ö:denormalize,ÖÐÎÄ·Òë³ÉɶÎÒ²»ÖªµÀ),ÔÊÐí²¿·ÖÊý¾ÝÈßÓà,±ÜÃâJOIN²Ù×÷,ÒÔÌá¸ß²éѯЧÂÊ
(2).ϵͳ¼Ü¹¹Éè¼Æ·½Ãæ,±íÉ¢ÁÐ,°Ñº£Á¿Êý¾ÝÉ¢Áе½¼¸¸ö²»Í¬µÄ±íÀïÃæ.¿ìÂý±í,¿ì±íÖ»Áô×îÐÂÊý¾Ý,Âý±íÊÇÀúÊ·´æµµ.¼¯Èº,Ö÷·þÎñÆ÷Read & write,´Ó·þÎñÆ÷read only,»òÕßN̨·þÎñÆ÷,¸÷»úÆ÷»¥ÎªMaster
(3).(1)ºÍ(2)³¬Ô½PHP ProgrammerµÄÒªÇóÁË,»á¸üºÃ,²»»áû¹Øϵ.¼ì²éÓÐûÓÐÉÙ¼ÓË÷Òý
(4).д¸ßЧµÄSQLÓï¾ä,¿´¿´ÓÐûÓÐ
Ïà¹ØÎĵµ£º
Èç¹û²»¾ß±¸ÐÞ¸Äphp.iniµÄȨÏÞ£¬¿ÉÒÔÈçÏ£º
ini_set("display_errors", "On");
error_reporting(E_ALL | E_STRICT);
µ±È»£¬Èç¹ûÄܹ»ÐÞ¸Äphp.iniµÄ»°£¬Èçϼ´¿É£º
display_errors = On
error_reporting = E_ALL & ~E_NOTICE ......
±¾À´²»Ïë̸Õâ¸ö³ÁÖصĻ°Ì⣬Æäʵ˵°×ÁË£¬Èç¹ûÄãÒ»¸öPHPµÄ³ÌÐòÔ±Á¬ÔõôÅäÖû·¾³¶¼¸ã²»¶¨Ä㻹¸ã¸öP¿ª·¢Ñ½¡£µÃ£¬ÔÛ²»ËµÄãÔÚlinuxÏÂÃæ¸ã¶¨ÕâЩ£¬ÄѵÀÄãÔÚwindowsÏÂÃæÄãÒ²¸ã²»¶¨£¿
ÏÖÔÚµÄPHP¶þ½øÖÆ°²×°°æ±¾ÒѾ¿ÉÒÔÖ§³Öapache,iis5,iis6µÈһЩWEB·þÎñÆ÷ÁË£¬ÎªÊ²Ã´»¹ÊÇÓÐһЩÈ˲»»áÅäÖÃÄØ£¿ÕæÏ벻ͨѽ¡£¡£¡£¡£¡£¡£
ÓÚÊÇÔÚÕâÖÖ´ó ......
°ÑphpÊý¾Ý»òÖµ´«µÝ¸øjs
£ººÜ¼òµ¥£¬Ö±½ÓÔÚjsÖÐʹÓÃphp´úÂ룬»ì±à¼´¿É¡£
°ÑjsÊý¾Ý´«µÝ¸øphp
£º¿ÉÒÔʹÓôò¿ªÐ´°¿ÚµÄ·½Ê½£¬Í¨¹ýurlµØÖ·°ÑÊý¾Ý´«µÝ¹ýÈ¥¡£Ò²¿ÉÒÔʹÓÃajax£¬Í¨¹ýget»òpost´«µÝ¸øphp£¬Ò²¿ÉÒÔ±£´æcookieÈÃphpÀ´¶Á¡£
ÔÚ´«µÝÊý¾Ý¹ý³ÌÖпÉÄÜÓöµ½ÖÐÎıàÂë
ÎÊÌ⣬¿ÉÒÔͳһ±àÂ뷽ʽΪjsµÄescape£¬unescape£¬Ò²¿ÉÒÔÍ³Ò ......
<?php
//$str = "abcdef¡ôÖлªÈËÃñ¹²ºÍ¹ú";
//$str = "1234567890";
$str = "ÖлªÈËÃñ¹²ºÍ¹úabcÖлªÈËÃñ¹²ºÍ¹úÖлªÈËÃñ¹²ºÍ¹ú";
$str = cut_str($str, 18);
echo $str;
function cut_str($str, $len){
if(strlen($str) <= $len) return $str;
$n = 0;
$tempstr = '';
for($i = 0; ......
½ñÌìÔÚдһ¸ö¶«Î÷ʱ£¬·¢ÏÖʱ¼äÒ»Ö±¶Ô²»ÉÏ£¬date("Y-m-d h:i:s") ×ÜÊÇÓë·þÎñÆ÷ʱ¼ä²î¼¸¸öСʱ£®
ÔÀ´´Óphp5.1.0¿ªÊ¼£¬php.iniÀï¼ÓÈëÁËdate.timezoneÕâ¸öÑ¡ÏĬÈÏÇé¿öÏÂÊǹرյÄ
Ò²¾ÍÊÇÏÔʾµÄʱ¼ä£¨ÎÞÂÛÓÃʲôphpÃüÁ¶¼ÊǸñÁÖÍþÖαê׼ʱ¼ä
ºÍÎÒÃǵÄʱ¼ä£¨±±¾©Ê±¼ä£©²îÁËÕýºÃ8¸öСʱ
½â¾ö·½Ê½:
Ò»¡ ......