How do you interpret the function of uploading a file format?

Source: Internet
Author: User
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]
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.