This determines how the upload file Format function interprets
This post was last edited by lyhjc_2014 on 2014-11-21 08:28:12
Never understand, what does he mean by every sentence?
function F_postfix ($f _type, $f _upfiles) {
$is _pass = false;
$tmp _upfiles = Split ("\.", $f _upfiles);
$tmp _num = count ($tmp _upfiles);
for ($num = 0; $num < count ($f _type); $num + +) {
if (Strtolower ($tmp _upfiles[$tmp _num-1]) = = $f _type["$num"])
$is _pass = $f _type["$num"];
}
return $is _pass;
}
------to solve the idea----------------------
$f _type, what is this thing? Do not know what the function parameter means, only from the literal analysis function.
$is _pass = false;//Declaration traversal
$tmp _upfiles = Split ("\.", $f _upfiles);//String cut array
$tmp _num = count ($tmp _upfiles);//number of sibling arrays
for ($num = 0; $num < count ($f _type); $num + +) {//traversal array
if (Strtolower ($tmp _upfiles[$tmp _num-1]) = = = $f _type["$num"])//numerical comparison
$is _pass = $f _type["$num"];//re-assigned
}
Return $is _pass;//returns results
------to solve the idea----------------------
$f _type should be allowed to upload the type, array, lowercase, subscript starting from 0
$tmp _upfiles = Split ("\.", $f _upfiles);//will pass in the file name (or possibly the path) with "." Split array
------to solve the idea----------------------
$tmp _upfiles = Array (1.2.3. 4);
$tmp _num = count ($tmp _upfiles); 4
$tmp _upfiles[$tmp _num-1] is
$tmp _upfiles[4-1] = $tmp _upfiles[3]