PHPÖеÄħÊõ·½·¨
PHPÖÐÓÐÏÂÁгÆÖ®ÎªÄ§Êõ·½·¨(magic method)µÄº¯Êý:__construct, __destruct ,
__call, __callStatic,__get, __set, __isset, __unset , __sleep, __wakeup,
__toString, __set_state, __clone and __autoload,±¾ÎÄʹÓÃ__callΪʵÏÖÒ»¸öÉí·ÝÑéÖ¤µÄ¼òµ¥ÊµÀý£¬´úÂëÈçÏ£º ´úÂë<?php
interface Accountable
{
const ERR_MSG = "error";
public function isLoggedIn();
public function getAccount($user = '');
}
abstract class Authentication implements Accountable
{
private $account = null;
public function getAccount($user = '')
{
if ($this->account != null) {
return $this->account;
} else {
return ERR_MSG;
}
}
public function isLoggedIn()
{
return ($this->account != null);
}
}
class 
Ïà¹ØÎĵµ£º
in_array(value,array,type) //¼ì²éÒ»¸öÖµÊÇ·ñÔÚÊý×éÖÐ,type¿ÉÑ¡,ÉèÖÃΪtrue¼ì²éÀàÐÍÊÇ·ñÏàͬ,·Ö´óСд
Àý:
$os = array("Mac", "NT", "Irix", "Linux");
if (in_array("Irix", $os)) {
echo "Got Irix";
......
PHPÓÃmkdir()н¨Á¢Ä¿Â¼ÎÞдµÄȨÏÞµÄÎÊÌâ
ÔÄÀÀ´ÎÊý:
½ñ
Ìì:0 ×Üä¯ÀÀ:526
ÎÄÕÂÀ´Ô´: CPÕûÀí
ÔÎÄ×÷Õß:
ÕûÀíÈÕÆÚ: 2008-08-14
º¯ÊýmkdirÓÐÁ½¸ö²ÎÊý£¬Ä¿Â¼Â·¾¶ºÍ·ÃÎÊȨÏÞ
Àýmkdir('/tmp/test',0777)
È»ºóÒªµÃµ½µÄȨÏÞÂ룬²»Ò»¶¨ÊÇÉϱßÉ趨µÄ£¬µ±Ç°ÏµÍ³µÄumask½«»áÓëÉ趨µÄÖµ‘Óë’£¬ÕâÑù×Ó²ÅÊÇÕæÕýµÄȨÏÞ ......
Ò»°ãµÄÎļþ°²È«ÏÂÔØ·½·¨¿ÉÒÔʹÓÃÏÂÃæµÄ´úÂë:
1. <?php?
2.
3. $durl = 'file/phpcms2008_o2abf32efj883c91a.iso';
4. $filename = 'phpcms2008_o2abf32efj883c91a.iso';
5. $file = @fopen($durl, 'r');
6. header("Content-Type: application/octet-stream");
......
½ñÌìÓöµ½ÁËÒ»¸ö¹ÖÎÊÌ⣬ÎÒÓÃ$fp=fopen("access_log.txt","ab")´ò¿ªÒ»¸öÎļþºó¿ªÊ¼ÍùÀïÃæÐ´Êý¾Ý£¬Ð´µÄÄÚÈÝÊÇ 'XXX\nXXX\n'£»
µ«ÊÇÆæ¹ÖµÄÊÇ ²»¹ÜÎÒÔõôÍùÀïÃæÐ´ ËûÊDz»»»ÐÐ,¼Çʱ¾Àï¼Ç¼µÄÊý¾Ý ¾ÍÊÇ 'xxx\nxxx\n'£¬
ºÜÊÇÄÕ»ð£¬È¥ÍøÉÏËѼ¯×ÊÁÏ£¬ÓеÄ˵¸Ä³É'\r\n'ʲôµÄ£¬½á¹ûÊÇд½øÈ¥ºó»¹ÊÇ 'xxx\r\nxx ......