·ÖÏíÒ»¸öPHP·ÖÒ³´úÂë
<?php
//µ÷ÊÔÊä³öÐÅÏ¢
$pageCount=15;
for($i=1;$i<=$pageCount;$i++){
dump(GetPageRange($i,$pageCount),$i);
}
//$currentPage µ±Ç°Ò³Âë
//$pageCount ×ÜÒ³Êý
//$leftSize ×ó²àÒ³Â뷶Χ
//$rightSize ÓÒ²àÒ³Â뷶Χ
//·µ»ØÒ³ÂëÇø¼äÊý×é
function GetPageRange($currentPage,$pageCount,$leftSize=3,$rightSize=4)
{
if($pageCount<=0 || $leftSize<0 || $rightSize<0){
return array();
}else{
$startPage=$currentPage;
$endPage=$currentPage;
while($leftSize>0){
if($startPage<=1) break;
$startPage--;
$leftSize--;
}
while($rightSize>0){
if($endPage>=$pageCount) break;
$endPage++;
$rightSize--;
}
}
return range($startPage,$endPage);
}
//µ÷ÊÔÊä³öÐÅÏ¢
//$array Ò³ÂëÇø¼äÊý×é
//$currentPage µ±Ç°Ò³Âë
function dump($array,$currentPage=0){
echo "<div style='clear:both;height:30px;'>";
echo "<li style="float:left;" mce_style="float:left;">µ±Ç°Ò³ÊÇ£º<span style='width:30px;color:red;font-weight:bold;'>".$currentPage."</span>·ÖÒ³Çø¼äÏÔʾΪ£º</li>";
for($i=0;$i<count($array);$i++){
echo "<li style='list-style:none;float:left;width:30px;'>";
if($array[$i]==$currentPage) {
echo "<span style='color:999;background:#000;border:1px #eee solid;width:24px;text-align:center;'>".$array[$i]."</span>";
}else{
echo "<span style='border:1px #ccc solid;width:24px;text-align:center;'>".$array[$i]."</span>";
}
echo "</li>";
}
echo "</div>";
}
?>
Ïà¹ØÎĵµ£º
ÕâÀïҲǿÁÒÍƼöYII¿ò¼Ü£¬Õâ¸öÄêÇáµÄ¿ò¼ÜÓÉÃÀ¹ú»ªÈË¿ª·¢£¬Ãû½ÐѦǿ¡£Yii FramworkÊÇ2009×î¼ÑPHP¿ò¼Ü¡£
Yii ÊÇÒ»¸ö»ùÓÚ×é¼þ¡¢ÓÃÓÚ¿ª·¢´óÐÍ Web Ó¦ÓõĸßÐÔÄÜ PHP ¿ò¼Ü¡£Ëü½« Web ±à³ÌÖеĿÉÖØÓÃÐÔ·¢»Óµ½¼«Ö£¬Äܹ»ÏÔÖø¼ÓËÙ¿ª·¢½ø³Ì¡£Yii£¨¶Á×÷“Ò×”£©´ú±í¼òµ¥(easy)¡¢¸ßЧ( ......
À´Ô´ÓÚ£ºhttp://news.csdn.net/a/20100201/216819.html
CSDN±¨µÀ
SDTimes¸ß¼¶±à¼Alex HandyÔÚ²©¿Í
Öб¬ÁÏ£¬ÉÏÖÜFacebookÑûÇëÁËPHPºËÐÄÍŶӵ½¹«Ë¾ÌÖÂÛËûÃǵÄÐÂÏîÄ¿£º´ÓÍ·ÖØдµÄPHPÔËÐп⡣ÖܶþËûÃǽ«Õýʽ·¢²¼Õâ¸öÏîÄ¿£¬²¢¿ªÔ´¡£
HandyÏàÐÅ£¬ÕâÊÇÁ½ÄêÇ°FacebookÕÐÀ¿µÄһλPHP¸ßÊÖËùΪ¡£
µ«Ò²ÓÐÍøÓÑÔÚ²©¿ÍÏÂÁôÑÔ˵£¬Fac ......
¡¾2010/2/4¡¿
1:
·ÅÁË6¸öÎļþÔÚcÅÌÏÂ(php.ini,php5ts.dll,libmysql.dll ,php_gd2.dll,php_mysql.dll,php_mbstring.dll ),Ò»¸öÔÚwindowsÏÂ,ÁíÎå¸öÔÚwindows/system32ÏÂ
2:
ÅäÖÃÁËpath,c:\phpºÍc:\php\ext,(²»¹ýºÃÏóûʲô×÷ÓÃ)
3:
ÃüÁî:httpd.exe -w -n "Apache2" -k start À´²é¿´ÊÇÄÄÒ»ÐеĴíÎóÐÅÏ¢.
×ܽá:µ½ÏÖÔÚ뻅 ......
ºÚ¿ÍÈëÃż¼ÊõÖ®php+mysql×¢ÉäÓï¾ä¹¹Ô죺
Ò».Ç°ÑÔ£º
²âÊÔ°æ±¾ÐÅÏ¢£ºOkphp BBS v1.3 ¿ªÔ´°æ
ÓÉÓÚPHPºÍMYSQL±¾ÉíµÃÔÒò,PHP+MYSQLµÄ×¢ÉäÒª±ÈaspÀ§ÄÑ£¬ÓÈÆäÊÇ×¢ÉäʱÓï¾äµÄ¹¹Ôì·½Ãæ¸üÊǸöÄѵ㣬±¾ÎÄÖ÷ÒªÊǽè¶ÔOkphp BBS v1.3һЩÎļþµÃ¼òµ¥·ÖÎö£¬À´Ì¸Ì¸php+mysql×¢ÉäÓï¾ä¹¹Ô췽ʽ£¬Ï£Íû±¾ÎĶÔÄãÓеã°ïÖú¡£
¡¡¡¡ÉùÃ÷£ºÎÄÕÂËùÓ ......
»¥ÁªÍøµÄ½ñÌ죬AJAXÒѾ²»ÊÇʲôİÉúµÄ´Ê»ãÁË¡£ËµÆðAJAX£¬¿ÉÄÜ»áÁ¢¼´ÏëÆðÒòRSS¶øÐËÆðµÄXML¡£XMLµÄ½âÎö£¬¿ÖÅÂÒѾ²»ÊÇʲôÄÑÌâÁË£¬ÌرðÊÇPHP5£¬´óÁ¿µÄXML½âÎöÆ÷µÄÓ¿ÏÖ£¬Èç×îÇáÁ¿¼¶µÄSimpleXML¡£²»¹ý¶ÔÓÚAJAXÀ´Ëµ£¬XMLµÄ½âÎö¸üÇãÏòÓÚǰ̨JavascriptµÄÖ§³Ö¶È¡£ÎÒÏëËùÓнâÎö¹ýXMLµÄÈË£¬¶¼»áÒòÊ÷ºÍ½Úµã¶øÍ·´ó¡£²»¿É·ñÈÏ£¬XMLÊÇºÜ ......