תÑÛ¼äÈýÄê¹ýÈ¥ÁË£¬·¢¾õ×Ô¼º¶¼»¹ÔÚÔµØ̤²½£¬Ë×»°Ëµ“ÄæË®ÐÐÖÛ£¬²»½øÔòÍË”£»ÈýÄê¼ä£¬´Óasp£¬javaµ½PHP£¬ÔÚ¼¸ÃÅÓïÑÔÖ®¼äշת£¬
ÿÃŶ¼»áÄÇôһµãµã£¬¾ÍÊDz»¾«Í¨£¬¸Ð¾õÿÑù¶¼ÄDz»´íÊÖ£¬ÏÖÔÚ϶¨¾öÐÄδÀ´ºÜ³¤Ò»¶Îʱ¼äÄÚ¶¼½«·ÖÅä¸øPHP£¬Ò»ÇоʹÓZend Framework¿ò¼Ü¿ªÊ¼°É ......
±±¾©´óѧÈí¼þÓë΢µç×ÓѧԺ“¶à²ã´Î¡¢¶à·½Ïò¡¢¶àÁìÓò¡¢Ä£¿é»¯” µÄ¿ª·Åʽ¿Î³ÌÌåϵ£¬¾Êµ¼ù¼ìÑéÖ¤Ã÷£¬·Ç³£ÊÊÓÃÓÚÅàÑø“¶à²ã´Î¡¢ÊµÓÃÐÍ¡¢¸´ºÏ½»²æÐÍ¡¢¹ú¼Ê»¯”µÄÈí¼þÓë΢µç×ÓÈ˲š£ÎªÂú×ãÉç»áºÍÆóÒµ¶ÔÈ˲ŵÄÐèÇ󣬶ԸßÖÊÁ¿µÄ¼ÌÐø½ÌÓýÏîÄ¿µÄÐèÇ󣬱±¾©´óѧÈí¼þÓë΢µç×ÓѧԺ³ÉÁ¢Á˼ÌÐø½ÌÓýÖÐÐÄ£¬ÃæÏòÉç»áºÍÆóÒµÐèÇó¿ªÕ¹¼ÌÐø½ÌÓýÏîÄ¿¡£
ѧԺµÄ¼ÌÐø½ÌÓý½«ÒÀÍб±¾©´óѧ¡¢±±¾©´óѧÈí¼þÓë΢µç×ÓѧԺµÄʦ×ʶÓÎé¡¢¿Î³ÌÌåϵ¡¢¼¼ÊõÓÅÊÆ¡¢¿ÆÑÐÓÅÊÆ£¬ÒÔ¼°Óë¹ú¼ÊÖøÃûԺУ¡¢ÆóÒµµÄºÏ×÷ÓÅÊƺ͹ú¼ÊÓ°ÏìÁ¦£¬ÃæÏòÉç»á¡¢²úÒµ¡¢ÆóÒµ¿ªÕ¹¶à²ã´ÎµÄ¼ÌÐø½ÌÓýÏîÄ¿£¬È«Ã濪չ“Ë«ÓÅ£¨Double U£©¹¤³Ì”£¬¼´ÖØÔÚ²»¶Ï´Ù½ø“ÈË”µÄ֪ʶ¸üУ¨Update£©ºÍËØÖÊÄÜÁ¦ÌáÉý£¨Upgrade£©¡£Ñ§Ôº¼ÌÐø½ÌÓýÍÆÐеē˫ÓŹ¤³Ì”½«²ÉÓÃ×éÖ¯“¸ß¼¶ÑÐÐ޿γÌϵÁДºÍ“Èí¼þ¿ª·¢ÏîĿʵѵ”Á½ÖÖ·½·¨¿ªÕ¹¡£
ѧԺ¼ÌÐø½ÌÓýÖÐÐÄÍƹãµÄ“Ë«ÓÅ£¨Double U£©¹¤³Ì”£¬Ò»·½ÃæΪ±±¾©´óѧÈí¼þÓë΢µç×ÓѧԺÔÌÓýÓÅÐãÉúÔ´¡¢ÁíÒ»·½Ã潫²»¶Ï·´À¡Êг¡ÐèÇ󣬴ٽøѧԺ¿Î³ÌÌåϵ¸üкͽÌѧÖÊÁ¿µ ......
±±¾©´óѧPHP¹¤³Ìʦ°àÕÐÉú¼òÕÂ
꿅᣼www.pku-it.com
½üÄêÀ´£¬PHPÓïÑÔÒÔÆä¼ò½àÁé»îµÄ±à³Ìģʽ¡¢ÈÕÇ÷ÍêÉƵļ¼ÊõÌåϵÒÔ¼°Ç¿ÓÐÁ¦µÄ¿ªÔ´Ö§³Ö£¬Ñ¸ËÙ·¢Õ¹³ÉΪȫÇò»¥ÁªÍøÓ¦ÓÃ×îΪ¹ã·ºµÄ±à³ÌÓïÑÔ¡£Ä¿Ç°ÒÑÓг¬¹ý40%µÄWEB³ÌÐòʹÓÃPHPÀ´±àд£¬°Ù¶È¡¢ÌÚѶ¡¢ÐÂÀË¡¢ËѺü¡¢TOMµÈ¸÷´ó»¥ÁªÍø¹«Ë¾ÒÔ¼°¸÷ÖÖСÐÍÃÅ»§ÍøÕ¾ºÍÉçÇø¶¼¹ã·ºÊ¹ÓÃPHP¼¼Êõ£¬ÆóÒµ¶ÔPHPÈ˲ŵÄÐèÇóÔ½À´Ô½´ó¡£µ«ÊÇ£¬ÒòΪPHPÈ˲Ŵ¢±¸²»×ã¼°½ÌÓýÅàѵµÄ²»½¡È«£¬µ¼ÖÂPHPÈ˲ÅØÑ·¦£¬ÔÚÊг¡ÉϹ©²»Ó¦Çó¡£
ΪÍƶ¯PHP¼¼ÊõÓ¦Óã¬ÏòÆóÒµÊäËͺϸñµÄPHP¼¼ÊõÈ˲ţ¬±±´óÈí¼þÓë΢µç×ÓѧԺÁªºÏÖÚ¶àÖªÃûÆóÒµ£¬¿ª°ì“PHP¹¤³Ìʦ°à”£¬ÏÖÃæÏòÉç»áÕÐÉú¡£
Ò»¡¢±¨ÃûÌõ¼þ
Æ·µÂÁ¼ºÃ£¬×ñ¼ÍÊØ·¨£»³Ô¿àÄÍÀÍ£¬ÇÚ·Ṳ̈ʵ£»¾ßÓÐÇ¿ÁÒ´ÓÊÂITÐÐÒµµÄÐËȤ£»¾ßÓд´ÐÂÒâʶºÍÍŶÓÐ×÷¾«Éñ¡£
¾ßÓмÆËã»úÍøÂçÏà¹Ø¼¼Êõ±³¾°£¬¾ß±¸Ò»¶¨µÄC»òÆäËûÓïÑÔ±à³ÌÄÜÁ¦¡£
¶þ¡¢´ÓÒµ·½Ïò
1¡¢PHPÈí¼þ¿ª·¢¹¤³Ìʦ
......
ÎÄÕ·ÖÀà:PHP±à³Ì
PHP chmod() º¯Êý (upload image permit)
PHP Filesystem º¯Êý
¶¨ÒåºÍÓ÷¨
chmod() º¯Êý¸Ä±äÎļþģʽ¡£
Èç¹û³É¹¦Ôò·µ»Ø TRUE£¬·ñÔò·µ»Ø FALSE¡£
Óï·¨
chmod(file,mode)
²ÎÊý
ÃèÊö
file
±ØÐè¡£¹æ¶¨Òª¼ì²éµÄÎļþ¡£
mode
¿ÉÑ¡¡£¹æ¶¨ÐµÄȨÏÞ¡£
mode ²ÎÊýÓÉ 4 ¸öÊý×Ö×é³É£º
µÚÒ»¸öÊý×ÖÓÀÔ¶ÊÇ 0
µÚ¶þ¸öÊý×ֹ涨ËùÓÐÕßµÄȨÏÞ
µÚ¶þ¸öÊý×ֹ涨ËùÓÐÕßËùÊôµÄÓû§×éµÄȨÏÞ
µÚËĸöÊý×ֹ涨ÆäËûËùÓÐÈ˵ÄȨÏÞ
¿ÉÄܵÄÖµ£¨ÈçÐèÉèÖöà¸öȨÏÞ£¬Çë¶ÔÏÂÃæµÄÊý×Ö½øÐÐ×ܼƣ©£º
1 - Ö´ÐÐȨÏÞ
2 - дȨÏÞ
4 - ¶ÁȨÏÞ
Àý×Ó
Java´úÂë
<?php
// ËùÓÐÕ߿ɶÁд£¬ÆäËûÈËûÓÐÈκÎȨÏÞchmod("test.txt",0600);// ËùÓÐÕ߿ɶÁд£¬ÆäËûÈ˿ɶÁ
chmod("test.txt",0644);// ËùÓÐÕßÓÐËùÓÐȨÏÞ£¬ÆäËûËùÓÐÈ˿ɶÁºÍÖ´ÐÐchmod("test.txt",0755);// ËùÓÐÕßÓÐËùÓÐȨÏÞ£¬ËùÓÐÕßËùÔÚµÄ×é¿É¶Áchmod("test.txt",0740);
?>
<?php
// ËùÓÐÕ߿ɶÁд£¬ÆäËûÈËûÓÐÈκÎȨÏÞchmod("test.txt",0600);// ËùÓÐÕ߿ɶÁд£¬ÆäËûÈ˿ɶÁ
chmod("t ......
ͨ³£ÎÒÃÇдһ¸öÀàÈçÏ£º
a.php
class A
{
public function __construct()
{
echo "hello world!";
}
}
page.php
require("a.php");
$a = new A();
ÎÒÃÇÊÇͨ¹ýÊÖ¹¤ÒýÓÃij¸öÀàµÄÎļþÀ´ÊµÏÖº¯Êý»òÕßÀàµÄ¼ÓÔØ
µ«Êǵ±ÏµÍ³±È½ÏÅÓ´ó£¬ÒÔ¼°ÕâЩÀàµÄÎļþºÜ¶àµÄʱºò£¬ÕâÖÖ·½Ê½¾ÍÏԵ÷dz£²»·½±ãÁË
ÓÚÊÇPHP5ÌṩÁËÒ»¸ö::auotload::µÄ·½·¨
ÎÒÃÇ¿Éͨ¹ý±àд¸Ã·½·¨À´×Ô¶¯¼ÓÔص±Ç°ÎļþÖÐʹÓõÄÀàÎļþ
page.php
function __autoload($classname)
{
$class_file = strtolower($classname).".php";
if (file_exists($class_file)){
require_once($class_file);
}
}
$a = new A();
ÕâÑù£¬µ±Ê¹ÓÃÀàAµÄʱºò£¬·¢ÏÖµ±Ç°ÎļþÖÐûÓж¨ÒåA£¬Ôò»áÖ´ÐÐautoloadº¯Êý£¬²¢¸ù¾Ý¸Ãº¯ÊýʵÏֵķ½Ê½£¬È¥¼ÓÔØ°üº¬AÀàµÄÎļþ
ͬʱ£¬ÎÒÃÇ¿ÉÒÔ²»Ê¹Óø÷½·¨£¬¶øÊÇʹÓÃÎÒÃÇ×Ô¶¨ÒåµÄ·½·¨À´¼ÓÔØÎļþ£¬ÕâÀï¾ÍÐèҪʹÓõ½º¯Êý
bool spl_autoload_register ( [callback $autoload_function] )
page.php
function my_own_loader($classname)
{
$class_file = strtolower($classname).".php";
if (file_exists($class_fil ......
Ò»£º½á¹¹ºÍµ÷ÓÃ(ʵÀý»¯)£º
class className{} £¬µ÷Óãº$obj = new className();µ±ÀàÓй¹Ô캯Êýʱ£¬»¹Ó¦´«Èë²ÎÊý¡£Èç$obj = new className($v,$v2...);
¶þ£º¹¹Ô캯ÊýºÍÎö¹¹º¯Êý£º
1¡¢¹¹Ô캯ÊýÓÃÓÚ³õʼ»¯£ºÊ¹ÓÃ__construct()£¬¿É´ø²ÎÊý¡£
2¡¢µ«Îö¹¹º¯Êý²»ÄÜ´ø²ÎÊý£¨ÓÃÓÚÔÚÏúÈ¥Ò»¸öÀà֮ǰִÐÐһЩ²Ù×÷»ò¹¦ÄÜ£©¡£Îö¹¹º¯ÊýÓÃ__destruct()×öÃû³Æ¡£Ôڽű¾Ö´ÐнáÊøʱ£¬PHP»áÏúµôÄÚ´æÖеĶÔÏó£¬Òò´Ë¿É²»ÓÃÎöÔ캯Êý£¬µ«ÓÐЩ±ÈÈçCOOKIEµÈ£¬¾ÍÓ¦µ±ÒªÓô˺¯ÊýÏúµô¡£
֪ʶµã£ºÔÚPHP4ÖÐÒ²ÌṩÁ˹¹Ô캯Êý£¬µ«Ê¹ÓõÄÊÇÓëÀàͬÃûµÄÀà·½·¨£¬ÔÚPHP5ÈÔÄܼæÈÝÕâÖÖ×ö·¨£¬µ±Ò»¸öÀàÖÐûÓаüº¬__constructʱ£¬»á²éÕÒÓëÀàͬÃûµÄ·½·¨£¬Èç¹ûÕÒµ½£¬¾ÍÈÏΪÊǹ¹Ô캯Êý£¬ÈçÏ£º
class test
{ var $b;
function test() { $this->b=5; }
function addab($c) { return $this->b+$c; }
}
$a = new test(); echo $a->addab(4); // ·µ»Ø 9
3¡¢PHP²»»á×Ô¶¯µ÷Óø¸ÀàµÄ¹¹Ô캯Êý(²»Ö§³Ö¹¹Ô캯ÊýÖØÔØ)£¬±ØÐëʹÓÃparent¹Ø¼ü×ÖÏÔʽµØµ÷Óá£
class employee{
function __construct()....
}
class Manager extents Employee{
&nb ......
×ܼǼÊý:2174; ×ÜÒ³Êý:363; ÿҳ6 Ìõ;
Ê×Ò³ ÉÏÒ»Ò³ [3] [4] [5] [6] 7
[8] [9] [10] [11] [12] ÏÂÒ»Ò³ βҳ