PHPº¯Êý
extract() //½«Êý×éÖеļüÃû×÷Ϊ±äÁ¿Ãû,¼üÖµ×÷Ϊ±äÁ¿Öµ
Àý:
form.html
<form action="action.php" method="post">
<input type="text" name="username">
<input type="password" name="password">
<input type="submit">
action.php
<?php
$p_test=extract($_POST);
echo $p_test; //Êä³öµÄÊDZäÁ¿µÄ¸öÊý3
extract($_POST); //Ï൱ÓÚ$username=$_POST['username']; $password=$POST['password'];
echo "Óû§Ãû=".$username; //Êä³öÓû§Ãû=username
echo "ÃÜÂë=".$password; //Êä³öÃÜÂë=password
?>
<?php
/* ¼Ù¶¨ $var_array ÊÇ wddx_deserialize ·µ»ØµÄÊý×é*/
$size = "large";
$var_array = array("color" => "blue",
"size" => "medium",
"shape" => "sphere");
extract($var_array, EXTR_PREFIX_SAME, "wddx");
echo "$color, $size, $shape, $wddx_size\n";
?>
ÉÏÀý½«Êä³ö£º
blue, large, sphere, medium
$size ûÓб»¸²¸Ç£¬ÒòΪָ¶¨ÁË EXTR_PREFIX_SAME£¬ÕâʹµÃ $wddx_size ±»½¨Á¢¡£Èç¹ûÖ¸¶¨ÁË EXTR_SKIP£¬Ôò $wddx_size Ò²²»»á±»½¨Á¢¡£EXTR_OVERWRITE ½«Ê¹ $size µÄֵΪ“medium”£¬EXTR_PREFIX_ALL ½«½¨Á¢Ð±äÁ¿ $wddx_color£¬$wddx_size ºÍ $wddx_shape¡£
±ØÐëʹÓùØÁªÊý×飬Êý×ÖË÷ÒýµÄÊý×齫²»»á²úÉú½á¹û£¬³ý·ÇÓÃÁË EXTR_PREFIX_ALL »òÕß EXTR_PREFIX_INVALID¡£
file_exists() //¼ì²éÎļþ»òĿ¼ÊÇ·ñ´æÔÚ
Àý:
<?php
$filename = 'c:\windows';
if (file_exists($filename)) {
echo $filename."´æÔÚ";
} else {
echo $filename."²»´æÔÚ";
}
?>
method_exists() //¼ì²éÀàµÄ·½·¨ÊÇ·ñ´æÔÚ
Àý:
<?php
$directory = new Directory('.');
var_dump(method_exists($directory,'read'));
?>
ÉÏÀý½«Êä³ö£º
bool(true)
str_replace(Òª±»Ìæ»»µÄ×Ö·û´®,Ìæ»»ÓõÄ×Ö·û´®,²Ù×÷×Ö·û´®[,Ìæ»»´ÎÊý¡¾¿ÉÑ¡²ÎÊý¡¿]);
ÔÚ¶¼²»Ê¹ÓÃÊý×éʱ£¬¸Ãº¯ÊýÖ±½ÓʹÓÃnew_needleÌæ»»ËùÓеÄneedle²¢·µ»ØÌæ»»ºóµÄ×Ö·û´®¡£È磺str_replace("m&quo
Ïà¹ØÎĵµ£º
µ¼¶Á£º ¡¡
¡¡Apache: ¡¡
¡¡¿ªÆô httpd.conf£¬¼ÓÈëÒÔÏÂÁ½ÐÐ: ¡¡
¡¡QUOTE: ¡¡
¡¡ServerTokens ProductOnly ¡¡
¡¡ServerSignature Off ¡¡
¡¡PHP: ¡¡
¡¡Òþ²Ø PHP °æ±¾¾ÍÊÇÒþ²Ø "X-Powered-By: PHP/5.1.2-1+b1" Õâ¸ö£¬¿ªÆô php.ini£¬¼ÓÈë: ¡¡
¡¡QUOTE: ¡¡
¡¡expose_php = Off ¡¡
¡¡Apache ½ûֹĿ¼ä¯ÀÀ: ¡¡
¡¡½ûֹĿ ......
ÏÖÔÚphpÓкܶ࿪·¢¿ò¼Ü£¬±ÈÈçzendµÄzendframe——Ò»¸öЧÂʺܵͣ¬µ«ÍþÁ¦ºÜ´óµÄ¾ÞÈË£¬symfony——Ò»¸öÊÊÓôóÐÍÓ¦ÓÃÈ´Ìå»ýÇáÇɵİïÊÖ£¬cakephp£¬codelgniter£¬thinkphp£¬fleaPHPµÈµÈÓÅÐã×÷Æ·¡£
Ò²ÐíÒòΪÕâ¸öÔÒò£¬phpºÜÄѳÉΪÖ÷Á÷¡£Ñ¡Ôñ¶àÁË·´¶ø²»ÖªµÀÑ¡ÔñÄĸöºÃ¡£²»ÏñjavaÓÐͳһµÄÖ÷Á÷¿ò¼Ü£¬Äã¿ÉÒÔÑ¡Ôñe ......
¸ÕдÍêÇ°ÃæµÄÈÕÖ¾£¬ÓÖ·¢ÏÖÒ»¸öBug:
¸ù¾ÝOracle¹Ù·½ÌṩµÄ˵Ã÷£º
http://www.oracle.com/technology/documentation/berkeley-db/db/programmer_reference/ext_php.html
class Db4µÄÉùÃ÷ÈçÏ£º
class Db4 {
function Db4($dbenv = null) {} // create a new Db4 object using
......
ÈçºÎÓÃphpɾ³ýÎļþÄØ£¿
phpÖÐÓиöº¯Êý½Ð×÷unlink¡£Ö»ÒªÒ»¸ö²ÎÊý£¬±íʾÎļþ·¾¶¾ÍÐÐÁË¡£
bool unlink ( string filename)
³É¹¦É¾³ý·µ»ØÕ棬·ñÔò·µ»Ø¼Ù¡£
Õâ´ÎÎÒÔÚÏîÄ¿ÖУ¬ÐèÒªÓõ½É¾³ýÎļþ²Ù×÷¡£ÎªÁËÍêÃÀµÄ²Ù×÷£¬Ê×ÏÈÒªÅжÏÒ»ÏÂÕâ¸ö·¾¶µÄÎļþÊÇ·ñ´æÔÚ£¬ÓÃfile_existsº¯Êý¡£ÈçÈô´æÔÚ£¬Ôòȥɾ³ýÎļþ¡£¾ßÌå´úÂëÈçÏ£º
i ......
PHP³ÌÐòºÍMySqlÊý¾ÝÂÒÂëÎÊÌâÔÒò¼°½â¾ö
ÂÒÂëÎÊÌâ¼òµ¥Ëµ¾ÍÊÇÊý¾Ý¿âдÈë¶ÁÈ¡£¬ÍøÒ³Îļþ£¬ÍøÒ³ÏÔʾʱ¼¸¸ö»·½ÚµÄ±àÂë²»Ò»ÖÂÔì³ÉµÄ¡£
ÂÒÂëÎÊÌâ
дÈëʱ£ºÒ³ÃæÌáȡдÈëÊý¾Ý±àÂëºÍдÈëÊý¾Ý¿âʱ±àÂë²»Ò»ÖÂ
¶Áȡʱ£º¶ÁÈ¡ºóËùÓñàÂëÓëÊý¾Ý¿âдÈëʱ²»Ò»ÖÂ
ÏÔʾʱ£º±àÂëÓëÊý¾Ý¿â¶ÁÈ¡ºóµÄÊý¾Ý²»Ò»ÖÂ
ºÜÏÔȻֻÓÐÈýÕ߶¼Í³Ò»²ÅÐУ ......