ÎÒµÄphpµÄѧϰ
<?
class upload{
private $name; //$_FILES['file'][name]
private $type; //$_FILES['file'][type]
private $tmp_name; //$_FILES['file'][tmp_name]
private $error; //$_FILES['file'][error]
private $size; //$_FILES['file'][size]
private $newf; //ÎļþÉÏ´«Â·¾¶ ĬÈÏΪ upload/
public function __construct($name,$type,$tmp_name,$error,$size,$newf="upload/"){
$this->name=$name;
$this->type=$type;
$this->tmp_name=$tmp_name;
$this->error=$error;
$this->size=$size;
$this->newf=$newf;
}
private function size(){ //ÉÏ´«´óС
if($this->size>(1024*1024)){ //ĬÈÏΪ 1MB
echo "<script>alert('ÄúÉÏ´«ÎļþÌ«´óÁË,²»ÄÜÉÏ´«£¡');history.back();</script>";
exit();
}
}
private function type(){ //Ö§³ÖÉÏ´«ÀàÐÍ
switch ($this->type)
{
case "image/pjpeg":
break;
case "image/gif":
break;
case "image/x-png":
break;
case "application/x-shockwave-flash": //swf
break;
case "text/plain": //text
break;
case "application/msword": //doc
break;
&nb
Ïà¹ØÎĵµ£º
±éÀúĿ¼Îļþ£¬Ìæ»»±àÂ벿·Ö£¬É¾³ýÔÎļþ£¬ÔÙÖØÐÂתÂëÔÎļþÄÚÈÝ£¬ÖØÐÂÉú³ÉÐÂÎļþ¡£
function explorerdir($sDir){
static $aTempArr=array();
$dp=opendir($sDir);
while ($sFileName = readdir($dp)){
if ($sFileName !='.' && $sFileName !='..'){
......
Warning
: Illegal offset type in
Warning
: Illegal offset type in isset or
empty in
Ç°¼¸Ììд³ÌÐòµÄʱºòÅöµ½Ò»¸öÕâÖÖ´íÎóÌáʾ
Èç¹ûÄãʹÓÃÕâÑùµÄ±íʾ·½·¨ÈçÏ£º
$arr = array();
class a
{
}
$o = new a;
echo $arr[$o];
¾Í»á³öÏÖÉÏÃæµÄ´íÎóÌáʾ£¬ÒòΪ²»ÄÜʹÓÃʵÀý»¯µÄ¶ÔÏóÀ´×÷ΪÊý×éµÄË÷Òý£¬»òÕßÔÚʹÓÃi ......
ÔÎÄÁ´½Ó£ºhttp://www.phpdo.net/index.php/20100410/55.html
ÔÚPHPÖиüÐÂÊý×éµÄÄÚÈÝ¿ÉÒÔÖ±½ÓÖ¸¶¨¼üÃû²¢ÇҶԸüüÃû¸³Öµ¡£ ÀýÈ磺
<?php
$php = array(“php”,”phpdo”,”phpdo.net”);
$php[2] = “www.phpdo.net”;
print_r($php);
&nbs ......
1¡¢ÔÚÅäÖÃmysqlʵÀýµÄÓïÑÔÑ¡Ïîʱ£¬Ñ¡Ôñutf-8
2¡¢ÔÚhtml,phpÒ³ÃæÖÐ ¼ÓÉÏ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />£¬Èç¹û²»ÐÐÔÙÔÚ phpÎļþ Æðʼ´¦¼Ó header("Content-Type:text/html;charset=utf-8");
3¡¢ÔÚphpÖÐ×öÊý¾Ý¿âÁ¬½Óʱ£¬ÎÒÓõÄʱpdoµÄÐÎʽ£¬Ë ......