? ??? ?? ??? ???? ??? PHP?? ?? ??? ??? ???? ????.
Jul 29, 2016 am 08:43 AM?? ?? $_FILES['doc'] ??? ?? ??, $path? ??? ??, $type? ???? ???? ?????(?? ?? doc ? docx ? ?? ???? ???? ?????). , ? ????? ??("doc",".docx")? ??? ? ??? ??? ?? "."? ??? ??? ???? ????.
?? ?? ??? ??? ????.
function upload($file,$path ,$type ){
$state = array();
$state['error'] = "true";
$alltype = ""; "/"
$path = Trim($path);
//$path ?? "/" ??
if(strlen(strrchr($path,'/')) <= 1){
$path .= "/";
}
//
??? ?? "." ??//?? ??? ???? ???? "/"<? ?????. ;span>< ;/span>
foreach($type as $key=>$typeone){
$type[$key] = $typeone = Trim($typeone)
if(strlen) (strchr($ typeone,".")) != strlen($typeone)){
$type[$key] = ".".$typeone;}
$alltype .= $typeone.'/ ';
}
$alltype = substr($alltype,0,strlen($alltype)-1); //??? "/" ??
if(empty($file['name'] )){
$state['error'] = "{$alltype} ??? ??? ????? ?????!"
$state['errorid'] = 8
return $state; } else {
if (!$file['error']) {
$state['name'] = $file['name']
$state['type'] = strrchr( $state['name '],'.');
if(in_array($state['type'],$type)){
$time = date("U")
$ state['upname' ] = $time.rand(1000,9999).$state['type']; //?? ?? ??
if(copy($file['tmp_name'],$path.$state[ 'upname']) ){
$state['time'] = date("U"); //??? ??
$state['error'] = false
return $state; ??>} else {
switch($file('error')){
?? 1: $state['error'] = $state['name']."???? ??????. ?? ??? ??? ?????. ?? ??! ";$state['errorid'] = 1;return $state;
?? 2: $state['error'] = $state['name']."??? ??, ???? ?? ??? ??? ?????. ???? ?? ??! ";$state['errorid'] = 2;return $state;
?? 3: $state['error'] = $state['name']."??? ??, ??? ?????? ????????! ";$state['errorid'] = 3;return $state;
?? 4: $state['error'] = $state['name']."??? ??, ???? ??? ?? ? ????. ! ";$state['errorid'] = 4;return $state;
?? 5: $state['error'] = $state['name']."??? ??, ?? ?? ??? ???????! ";$state['errorid'] = 5;return $state;
?? 6: $state['error'] = $state['name']." ?? ??? ??? ????! ";$state['errorid'] = 6;return $state;
???: $state['error'] = $state['name']."??? ??, ??? ???????! ";$state['errorid'] = 10;return $state;
}
}
} else {
$state['error'] = $state['name']." ??? ??! ???? ?? ??? ???? ????! ({$alltype})";
$state['errorid'] = 10;
return $state;
}
}
}
?>
???? ?????
?? ?? ?? ??
errorid ?? ID(??? ??? ???? ?)
?? ?? ???(?? "." ??) ???)
upname ???? ?? ??
time ??? ??(Unix epoch(1970-01-01 00:00) ??? ? ?)
?? ??
errorid ??
false / /??? ??
1 ??? ??, ?? ??? ?? ??? ??????!
2 ??? ??, ???? ?? ??? ???? ??? ??????.
3 ??? ??, ??? ??? ????????. ??>4 ??? ??, ???? ??? ?? ? ????!
5 ??? ??, ??? ?? ??? ??????.
6 ??? ??, ?? ?? ? ??? ??????! ?? ???!
8 ? ??? ????? ?????! //??? ?? ??? ?? ????
10 ???? ????? ??? ???????!
? ??? ? ??? ?? ??? ???? ??? ?????. PHP?? ??? ????? ??? ???? ? ??? ?? ??? ???? ??? ???? ?? PHP ????? ??? ?? ????? ??? ??? ????.

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

PHP ?? ??? ?? ???? ?? ? ????? ??? ?????. 1. ?? ??? ??? ??? ??? ? ? ??? ??? ??? ?? ?? ??? ???? ???????. 2. ?? ??? ???? ???? ? ?? ????? ?? ?? ?? ??? ?????. 3. $ _get ? $ _post? ?? Hyperglobal ??? ?? ???? ?? ??? ? ??? ??? ??????? ???????. 4. ?? ?? ?? ???? ?? ?? ?? ??? ?????? ?? ??? ??? ?? ??? ???????. ??? ??? ????? ??? ??? ?? ???? ????? ? ??? ? ? ????.

PHP ?? ???? ???? ????? ?? ? ??? ???? ?? ?? ? ??? ???? ?? ??? ?????? ??? ??? ? ? ???????. 1. ??? ?? CSRF? ???? ?? ??? ??? ???? ?????? ??? ???? FINFO_FILE? ?? ?? MIME ??? ?????. 2. ??? ??? ??? ???? ??? ?? ??? ?? ? WEB ????? ??? ???? ??????. 3. PHP ?? ??? ?? ? ?? ???? NGINX/APACHE? ??? ????? ?? ???? ?????. 4. GD ?????? ??? ? ?? ???? ??? ?? ??? ?? ????.

PHP ?? ???? ? ?? ???? ??? ????. 1. // ?? #? ???? ? ?? ??? ???? // ???? ?? ????. 2. ?? /.../ ?? ?? ?? ??? ????? ?? ? ?? ??? ?? ? ? ????. 3. ?? ?? ?? / if () {} /? ?? ?? ??? ????? ??? ?? ?? ?? ??? ???? ????? ???? ??? ?? ???? ???? ??? ? ??? ??????.

PHP ??? ???? ??? ??? ??? ????? ????. ??? ????? ?? ???? ??? "?? ? ?"??? "?"? ???????. 1. ??? ? ??? ??? DocBlock (/*/)? ?? ?? ??? ???? ??? ? ?? ???? ??????. 2. JS ??? ???? ?? ???? ??? ?? ??? ??? ?????. 3. ??? ?? ?? ?? ??? ???? ????? ????? ???? ?? ????? ???? ? ??????. 4. Todo ? Fixme? ????? ???? ? ? ??? ??? ???? ?? ?? ? ??? ???????. ??? ???? ?? ??? ??? ?? ?? ?? ???? ???? ? ????.

Ageneratorinphpisamemory- ???? Way-Erate-Overgedatasetsetsbaluesoneatimeatimeatimeatimallatonce.1.generatorsuseTheyieldKeywordTocroadtOpvaluesondemand, RetingMemoryUsage.2

tolearnpheffectical, startBysetTupaloCalserErverEnmentUsingToolslikexamppandacodeeditor -likevscode.1) installxamppforapache, mysql, andphp.2) useacodeeditorforsyntaxsupport.3)) 3) testimplephpfile.next, withpluclucincludechlucincluclucludechluclucled

PHP??? ???? ??? ?? ?? ????? ???? ??? ?? ??? ??? ?? ? ??? ??? ???? ?????. ???? 0?? ???? ?? ??? ???? ? ?? ???? ?? ?? ? ? ????. MB_SUBSTR? ?? ??? ??? ???????. ? : $ str = "hello"; echo $ str [0]; ?? H; ??? MB_SUBSTR ($ str, 1,1)? ?? ??? ??? ??? ??????. ?? ???????? ???? ??? ???? ?? ???? ?? ?? ???? ?????? ??? ????? ?? ??? ?? ??? ???? ???? ?? ????.

toinstallphpquickly, usexampponwindowsorhomebrewonmacos.1. ??, downloadandinstallxAmpp, selectComponents, startApache ? placefilesinhtdocs.2
