PHPµÄÈýµã¾«»ª½éÉÜ
ÎÒ·¢ÏֺܶàµÄPHP³ÌÐòÔ±£¬ÓÈÆäÊÇѧϰ»¹²»ÊǺܾõ쬶¼²»ÖªµÀPHPµÄ¾«»ªËùÔÚ¡£Perlµ±ÄêÈçºÎÔÚÉ̽ç³öÃû£¿ÆäÇ¿´óµÄÕýÔò±í´ïʽ¡£¶øPHPÄØ£¿ËûÊÇÒ»ÃÅ´ÓUnixÏ·¢Õ¹ÆðÀ´µÄÓïÑÔ£¬µ±È»Ò²¾Í¼Ì³ÐÁËPerlµÄºÜ¶àÌØµã£¬Í¬Ê±CµÄÓŵ㶼ÓС£¿ìËÙ¡¢¼ò½à¡¢Ã÷ÁË£¬ÓÈÆäÊÇC³ÌÐòÔ±£¬PHPÊÇÖÁ°®£¬ÎÒ¾ÍÊÇÉî°®×Å“PHP”£¨¶¼ÍüÁËÅ®ÓÑÁË:)£©¡£ÕâÀÎÒÏëÀ´Ð´Ò»ÆªPHPµÄ±äÁ¿¡¢Êý×éÓ¦Óü¼ÇɺÍPHPµÄÕýÔò±í´ïʽ¡¢PHPµÄÄ£°åÓ¦Óã¬ÒÔºóÓÐʱ¼äÔÙдPHPÓëCOM¡¢PHPÓëXMLµÄÍêÈ«½áºÏ¡£
1¡¢±äÁ¿¡¢Êý×éµÄÓ¦Óü¼ÇÉ
(1)ºÜ¶àÈËÓõò»¶àµÄÊý×麯Êý¡£foreach¡¢list¡¢each¡£·Ö±ð¾Ù¼¸¸öÀý×Ó£¬Ó¦¸Ã¾ÍÄÜÖªµÀÁË¡£Àý£º
<?php
$data = array('a' => 'data1', 'b' => 'data2', 'c' => 'data3');
while(list($subscript, $value) = each($data))
{
echo "$subscript => $value :: ";
echo "$subscript => $value <br>";
}
reset($data);
foreach($data as $subscript => $value)
{
echo "$subscript => $value :: ";
echo "$subscript => $value <br>";
}
(2)º¯ÊýµÄ±äÁ¿¡¢±äÁ¿µÄ±äÁ¿¡¢±äÁ¿µÄ“Ö¸Õ딣º¿´ÏÂÀý£º
<?php
//±äÁ¿µÄ±äÁ¿
$var = "this is a var";
$varname = "var";
echo $$varname;
//º¯ÊýµÄ±äÁ¿
function fun1($str) {
echo $str;
}
$funname = "fun1";
$funname("This is a function !");
?>
±äÁ¿µÄ“Ö¸Õ딡£Õâ¸öÖ¸Õë¼ÓÉÏÁËË«ÒýºÅ£¬±íÃ÷Ëû²»ÊÇÕæÕýµÄÖ¸Õë¡£¿´¿´ÏÂÀý£º
<?php
function($a) {
$a ++;
}
$c = 0;
function($c);
echo $c; //$cÈÔΪ0
function(&$a) {
$a ++;
}
$c = 0;
echo $c; //$cΪ1
?>
Ö®ËùÒÔ³ÆÆäΪ“Ö¸Õ딣¬¾ÍÊÇÒòΪËûÓÐÁ˺ÍCÓïÑÔÖÐÖ¸ÕëÏàͬµÄ¹¦ÄÜ¡£µ«ÕâÓÖ²»ÊÇÕæÕýµÄÖ¸Õ룬ֻÄܹ»ÊÇÕâÑùµÄÈ¥Àí½â¡£
2¡¢ÕýÔò±í´ïʽ
ÕýÔò±í´ïʽÊÇÒ»¸ö·Ç³£´óµÄÌâÄ¿£¬PerlµÄÕýÔò±í´ïʽµÄÇ¿´ó
Ïà¹ØÎĵµ£º
¡¡[AJAX½éÉÜ]
¡¡¡¡AjaxÊÇʹÓÿͻ§¶Ë½Å±¾ÓëWeb·þÎñÆ÷½»»»Êý¾ÝµÄWebÓ¦Óÿª·¢·½·¨¡£WebÒ³Ãæ²»Óôò¶Ï½»»¥Á÷³Ì½øÐÐÖØÐ¼Ӳ㬾ͿÉÒÔ¶¯Ì¬µØ¸üС£Ê¹ÓÃAjax£¬Óû§¿ÉÒÔ´´½¨½Ó½ü±¾µØ×ÀÃæÓ¦ÓõÄÖ±½Ó¡¢¸ß¿ÉÓᢸü·á¸»¡¢¸ü¶¯Ì¬µÄWebÓû§½çÃæ¡£
¡¡¡¡Òì²½JavaScriptºÍXML£¨AJAX£©²»ÊÇʲôм¼Êõ£¬¶øÊÇʹÓü¸ÖÖÏÖÓм¼Êõ——°ü ......
½ñÌìÊÇÒ»¸öÖµµÃ¼ÍÄîµÄÈÕ×Ó,ÖÕÓڰѱðµÄÊÂÇé¶¼¸ÉµôÁË,¿ÉÒÔÒ»ÐÄÒ»ÒâµÄѧϰÎÒ×î°®µÄPHPÁË,С»¶ºôÒ»ÏÂ.Ò®~~
Ê×ÏÈ.½áºÏ×Ô¼ºµÄ˼¿¼,ÓÐÁ˼¸¸ö¹ØÓÚ1+1=2µÄ±íʾ·½·¨,¾ßÌåÂÞÁÐÈçÏÂ:
Ê×ÏÈÊÇÒ»Öֺܼòµ¥µÄ±íʾ·½·¨:
<?php
$a =1+1;
echo "1+1=".$a;
?>
//ÕâÖÖ·½·¨ÓõIJ¢²»¶à,Ö»ÊÇΪÁ˼ÓÉî¶Ô±äÁ¿ ......
ÔÚ PHP ±à³ÌÔçÆÚ£¬PHP ´úÂëÔÚ±¾ÖÊÉÏÊÇÏÞÓÚÃæÏò¹ý³ÌµÄ¡£¹ý³Ì´úÂë µÄÌØÕ÷ÔÚÓÚʹÓùý³Ì¹¹½¨Ó¦ÓóÌÐò¿é¡£¹ý³Ìͨ¹ýÔÊÐí¹ý³ÌÖ®¼äµÄµ÷ÓÃÌṩijÖ̶ֳȵÄÖØÓá£
µ«ÊÇ£¬Ã»ÓÐÃæÏò¶ÔÏóµÄÓïÑÔ¹¹Ô죬³ÌÐòÔ±ÈÔÈ»¿ÉÒÔ°Ñ OO ÌØÐÔÒýÈëµ½ PHP ´úÂëÖС£ÕâÑù×öÓеãÀ§ÄѲ¢ÇÒ»áʹ´úÂëÄÑÓÚÔĶÁ£¬ÒòΪËüÊÇ»ìºÏ·¶Àý£¨º¬ÓÐα OO Éè¼ÆµÄ¹ý³ÌÓïÑÔ£ ......
ÕªÒª ±¾ÎĽéÉÜPHPµÄÓŵãºÍÌØÕ÷£¬½áºÏʵÀý²ûÊöÁËPHP·ÃÎÊMySQLÊý¾Ý¿âµÄ·½·¨¡£
PHP MySQL ODBC
1. ÒýÑÔ
ÔÚInternetÓ¦ÓÃÖУ¬½«·þÎñÆ÷¶Ë½Å±¾¼¼ÊõºÍ¿Í»§¶Ë½Å±¾¼¼Êõ½áºÏÆðÀ´¿ÉÒÔÖÆ×÷³ö·á¸»¶à²ÊµÄÒ³Ãæ¡£CGIºÍASPÊDZȽÏÁ÷ÐеķþÎñÆ÷¶Ë½Å±¾¼¼Êõ¡£Í¨³£CGIÔÚ¿çÆ½Ì¨µÄ¿ª·¢ÖаçÑÝ×ÅÖ÷Òª½ÇÉ«£¬¿ÉÒÔʹÓÃVB¡¢C»òPerlµÈÀ´Ê ......
PHP Security for Deployers
If you're a Developer
READ THIS and then work with your SysAdmins to step through any and all the layers of security designed to protect your apps.
Example:
Traffic must first pass through a SPI firewall (ensure that ONLY necessary ports/protocols are permitted; en ......