PHP»ù±¾Óï·¨£¨Æߣ©—— º¯Êý
º¯Êý
´´½¨ PHP º¯Êý
º¯ÊýÊÇÒ»ÖÖ¿ÉÒÔÔÚÈκα»ÐèÒªµÄʱºòÖ´ÐеĴúÂë¿é¡£
´´½¨ PHP º¯Êý£º
1 ËùÓеĺ¯Êý¶¼Ê¹Óùؼü´Ê "function()" À´¿ªÊ¼
2 ÃüÃûº¯Êý - º¯ÊýµÄÃû³ÆÓ¦¸ÃÌáʾ³öËüµÄ¹¦ÄÜ¡£º¯ÊýÃû³ÆÒÔ×Öĸ»òÏ»®Ïß¿ªÍ·¡£
3 Ìí¼Ó "{" - ¿ª¿ÚµÄ»¨À¨ºÅÖ®ºóµÄ²¿·ÖÊǺ¯ÊýµÄ´úÂë¡£
4 ²åÈ뺯Êý´úÂë
5 Ìí¼ÓÒ»¸ö "}" - º¯Êýͨ¹ý¹Ø±Õ»¨À¨ºÅÀ´½áÊø¡£
Àý×Ó
Ò»¸ö¼òµ¥µÄº¯Êý£¬ÔÚÆä±»µ÷ÓÃʱÄÜÊä³öÎÒµÄÃû³ÆµÄ£º
<html>
<body>
<?php
function writeMyName()
{
echo "David Yang";
}
writeMyName();
?>
</body>
</html>
ʹÓà PHP º¯Êý
ÏÖÔÚ£¬ÎÒÃÇÒªÔÚ PHP ½Å±¾ÖÐʹÓÃÕâ¸öº¯ÊýÁË£º
<html>
<body>
<?php
function writeMyName()
{
echo "David Yang";
}
echo "Hello world!<br />";
echo "My name is ";
writeMyName();
echo ".<br />That's right, ";
writeMyName();
echo " is my name.";
?>
</body>
</html>
ÒÔÉÏ´úÂëµÄÊä³ö£º
Hello world!
My name is David Yang.
That's right, David Yang is my name.
PHP º¯Êý - Ìí¼Ó²ÎÊý
ÎÒÃǵĵÚÒ»¸öº¯ÊýÊÇÒ»¸ö·Ç³£¼òµ¥µÄº¯Êý¡£ËüÖ»ÄÜÊä³öÒ»¸ö¾²Ì¬µÄ×Ö·û´®¡£
ͨ¹ý¿ÉÒÔÌí¼Ó²ÎÊý£¬ÎÒÃÇÏòº¯ÊýÌí¼Ó¸ü¶àµÄ¹¦ÄÜ¡£²ÎÊýÀàËÆÒ»¸ö±äÁ¿¡£
Äú¿ÉÄÜ×¢Òâµ½ÁË£¬º¯ÊýÃû³ÆºóÃæÓÐÒ»¸öÀ¨ºÅ£¬±ÈÈç writeMyName()¡£²ÎÊý¾ÍÊÇÔÚÀ¨ºÅÖй涨µÄ¡£
Àý×Ó 1
ÏÂÃæµÄÀý×Ó½²Êä³ö²»Í¬µÄÃû×Ö£¬µ«ÐÕÊÇÏàͬµÄ£º
<html>
<body>
<?php
function writeMyName($fname)
{
echo $fname . " Yang.<br />";
}
echo "My name is ";
writeMyName("David");
echo "My name is ";
writeMyName("Mike");
echo "My name is ";
writeMyName("John");
?>
</body>
</html>
ÉÏÃæµÄ´úÂëµÄÊä³ö£º
My name is David Yang.
My name is Mike Yang.
My name is John Yang.
Ïà¹ØÎĵµ£º
http://blog.s135.com/read.php/142.htm
¡¡¡¡×î½üÔÚдPHP³ÌÐòʱ£¬ÐèҪʹä¯ÀÀÆ÷ÔÚhttpsºÍhttpÖ®¼äת»¯£¬ÉÏÍøËÑË÷Ïà¹ØÐÅÏ¢£¬ÎÞÄÎÖ»ÓÐ×î½üÔÚдPHP³ÌÐòʱ£¬ÐèҪʹä¯ÀÀÆ÷ÔÚhttpsºÍhttpÖ®¼äת»¯£¬ÉÏÍøËÑË÷Ïà¹ØÐÅÏ¢£¬ÎÞÄÎÖ»ÓÐһƪ½éÉÜÓÃASPʵÏÖ“ÔÚhttpºÍhttpsÖ®¼äת»¯”µÄÎÄÕ£¬ÓÚÊÇÖ»ºÃÐÐдÁËÓÃPHPʵÏÖhttpÓëhttpsת» ......
<html>
<head>
<title>Uploading...</title>
</head>
<body>
<h1>Uploading file...</h1>
<?php
echo '<pre>';
print_r($_FILES);
echo '</pre>';
if ($_F ......
¹úÍâÔ½À´Ô½¶àµÄ¹«Ë¾¿ª·¢FacebookÓ¦Óã¬ÖÁÓÚ¹úÄÚÔÝÇÒ²»±í£¬´ó¼ÒÐÄÖª¶ÇÃ÷¡£»¹ºÃHKÒ²ËãÊÇÌ쳯ϽÇø£¬±¾ßÖÐÒ²Ëã´øÓаëÏ´¾ß……¿ª·¢Á˼¸¿îFacebookÓ¦Óã¬×ܽá¾Ñé½Ìѵ£¬ÔÚÒµÓàʱ¼ä¿ª·¢ÁËÒ»¿îFacebookÓ¦ÓÃPHP¿ª·¢¿ò¼Ü——Fabos¡£
Ϊɶ½ÐFabos£¿ÎÒÓÐÒ»¸öfabosÓòÃû£¬±»ºÍг£¡¾ÍËã×ö¸ö¼ÍÄҲµ±×öÊÇÒµÓàʱ¼ä ......
1¡¢
Ê×ÏÈÈ¥http://pear.php.net/package/Pager ÏÂÔØ Pager°ü£ºPager-2.4.8.tgz
£»
2¡¢
½âѹµ½×Ô¼ºµÄ¹¤×÷Ŀ¼
3¡¢
ʾÀýÈçÏ£º
<?php
require_once('Pager/Pager.php');
$params = array(
'itemData' => $re, //Òª½øÐзÖÒ³µÄ½á¹ûÊý×é
'perPage' => 12, //ÿҳµÄ¼Ç¼Êý
'd ......
//1. Óû§ÃÜÂëÁùλÊý,²»ÄÜ´óÓÚÁùλ¶ø²»ÄÜСÓÚÁùÊý,Êý×ÖÖµÕýÔòΪ[0-9],ÇëÓÃPHPд³öÓм¸ÖÖ¿ÉÄÜÐÔ,²¢×ö±©Á¦Æƽâ;
function dePassword($pwd) {
$tmp = array('000000', '555555', '999999');
for ($i = 0; $i < 3; $i++) {
if ($pwd == $tmp[$i]) return $tmp[$i];
}
return $pwd < $tmp[1] ? getPwd(0, $pwd ......