当前位置: 首页>>代码示例>>PHP>>正文


PHP findexts函数代码示例

本文整理汇总了PHP中findexts函数的典型用法代码示例。如果您正苦于以下问题:PHP findexts函数的具体用法?PHP findexts怎么用?PHP findexts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了findexts函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getXMLs

function getXMLs($comp, $dept, $course)
{
    $dir = @opendir("CaptivateResults" . "/" . $comp . "/" . $dept . "/" . $course);
    $directory = "CaptivateResults" . "/" . $comp . "/" . $dept . "/" . $course;
    while (($file = readdir($dir)) !== false) {
        if (!is_dir($file) && findexts($file) == 'xml') {
            echo $file . "," . number_format(filectime($directory . "/" . $file), 0, '.', '') . ";";
        }
    }
    closedir($dir);
}
开发者ID:uiugor,项目名称:INS_API-s,代码行数:11,代码来源:internalserverread.php

示例2: CleanFileName

function CleanFileName($Raw, $extra = 0)
{
    $Raw = trim($Raw);
    $extension = findexts($Raw);
    $Raw = substr($Raw, 0, -strlen($extension));
    //$RemoveChars  = array( "([\40])" , "([^a-zA-Z0-9-])", "(-{2,})" );
    $RemoveChars = array('/[^a-zA-Z0-9 -]/', '/[ -]+/', '/^-|-$/');
    //$ReplaceWith = array("-", "", "-");
    $ReplaceWith = array("", "-", "");
    $Raw = preg_replace($RemoveChars, $ReplaceWith, $Raw);
    $Raw .= $extra == 0 ? "" : $extra;
    $Raw .= "." . $extension;
    return $Raw;
}
开发者ID:erwincornelis,项目名称:Artofyao.com,代码行数:14,代码来源:functions.php

示例3: updateCarMovie

 public function updateCarMovie($carmovie)
 {
     $error = false;
     //url
     if (trim($carmovie->getUrl()) == "") {
         $phpError["carmovieurl"] = "Url is a required field!";
         $error = true;
     } elseif ($carmovie->getTypeId() == 1) {
         if (strtolower(findexts($carmovie->getUrl())) != "wmv" && strtolower(findexts($carmovie->getUrl())) != "mp4") {
             $phpError["carmovieurl"] = "LR link must be a wmv or mp4 file!";
             $error = true;
         }
     } elseif ($carmovie->getTypeId() == 2) {
         if (strtolower(findexts($carmovie->getUrl())) != "mpg" && strtolower(findexts($carmovie->getUrl())) != "mpeg" && strtolower(findexts($carmovie->getUrl())) != "mov" && strtolower(findexts($carmovie->getUrl())) != "mp4") {
             $phpError["carmovieurl"] = "HR link must be mpg, mpeg, mov or mp4 file!";
             $error = true;
         }
     } elseif ($carmovie->getTypeId() == 3) {
         if (!isValidURL(trim($carmovie->getUrl()))) {
             $phpError["carmovieurl"] = "Not a valid link!";
             $error = true;
         }
     } elseif ($carmovie->getTypeId() == 4) {
         //to be defined
     } elseif ($carmovie->getTypeId() == 5) {
         //to be defined
     } else {
         $phpError["carmovieurl"] = "Type not found!";
         $error = true;
     }
     //text
     if (trim($carmovie->getText()) == "") {
         $phpError["carmovietext"] = "Text is a required field!";
         $error = true;
     }
     //car
     $dalCar = new DALCar();
     $nrCars = $dalCar->getCarCount($carmovie->getCarId());
     if ($nrCars == 0) {
         $phpError["carmoviecar"] = "Car not found!";
         $error = true;
     }
     if ($error == true) {
         return $phpError;
     } else {
         parent::updateCarMovie($carmovie);
         return $carmovie->getId();
     }
 }
开发者ID:janb87,项目名称:media-cars,代码行数:49,代码来源:BLCarMovie.php

示例4: mime_content_type

 function mime_content_type($file)
 {
     //Guess the mimetype based on extension
     if (is_dir($file)) {
         return "text/directory";
     }
     import("api.fs_mimetypes");
     global $fs_mimetypes;
     $ext = findexts($file);
     foreach ($fs_mimetypes as $key => $value) {
         if ($ext == $key) {
             return $value;
         }
         $exts = explode($key, " ");
         if (count($exts) > 0) {
             foreach ($exts as $check) {
                 if ($ext == $check) {
                     return $value;
                 }
             }
         }
     }
     return "text/plain";
 }
开发者ID:Rudi9719,项目名称:lucid,代码行数:24,代码来源:fs.php

示例5: findexts

    }
}
function findexts($filename)
{
    $filename = strtolower($filename);
    $exts = split("[/\\.]", $filename);
    $n = count($exts) - 1;
    $exts = $exts[$n];
    return $exts;
}
$target_path2 = "";
$target_path2 = "../../pdf/ad_files/";
$base_name2 = "";
if ($_FILES['ad_print']['name'] != "") {
    $random = rand(9999, 999999);
    $base_name2 = $random . "-" . $_SESSION["user_id"] . "." . findexts(basename($_FILES['ad_print']['name']));
    $target_path2 .= $base_name2;
    if (move_uploaded_file($_FILES['ad_print']['tmp_name'], $target_path2)) {
        $array['ad_link'] = $base_name2;
    }
}
for ($i = 1; $i <= 7; $i++) {
    $val = "duty" . $i;
    if (isset($_POST[$val])) {
        $array[$val] = $_POST[$val];
    }
}
for ($i = 1; $i <= 26; $i++) {
    $val = "hide" . $i;
    if (isset($_POST[$val])) {
        $array[$val] = $_POST[$val];
开发者ID:beyondkeysystem,项目名称:testone,代码行数:31,代码来源:job_edit_action.php

示例6: findexts

         exit;
         //new
     } else {
         echo "<script>alert('Authentication Error.');</script>";
     }
 } else {
     if (isset($_POST['sellProductSubmitButton'])) {
         $ext = findexts($_FILES['product_link1']['name']);
         $newfilename = random_string('10') . "." . $ext;
         $location1 = "files/" . $newfilename;
         move_uploaded_file($_FILES["product_link1"]["tmp_name"], "files/" . $newfilename);
         $ext = findexts($_FILES['product_link2']['name']);
         $newfilename = random_string('10') . "." . $ext;
         $location2 = "files/" . $newfilename;
         move_uploaded_file($_FILES["product_link2"]["tmp_name"], "files/" . $newfilename);
         $ext = findexts($_FILES['product_link3']['name']);
         $newfilename = random_string('10') . "." . $ext;
         $location3 = "files/" . $newfilename;
         move_uploaded_file($_FILES["product_link3"]["tmp_name"], "files/" . $newfilename);
         $user_id = mysql_real_escape_string($_SESSION['bns_id']);
         $productName = mysql_real_escape_string($_POST['product_name']);
         $productQuantity = mysql_real_escape_string($_POST['product_quantity']);
         $productPrice = mysql_real_escape_string($_POST['product_price']);
         $productDescription = mysql_real_escape_string($_POST['product_description']);
         $productCategory = mysql_real_escape_string($_POST['categoryName']);
         $productSubCategory = mysql_real_escape_string($_POST['subCategoryName']);
         $i = 0;
         $sql = "SELECT * FROM fields WHERE sub_category_id='{$productSubCategory}'";
         $result = mysql_query($sql);
         if (!$result) {
             die('Invalid query: ' . mysql_error());
开发者ID:anik801,项目名称:Vazaar,代码行数:31,代码来源:loginCheck.php

示例7: closedir

    return $exts;
}
// Closes directory
closedir($myDirectory);
// Counts elements in array
$indexCount = count($dirArray);
// Sorts files
sort($dirArray);
// Loops through the array of files
$count = 0;
for ($index = 0; $index < $indexCount; $index++) {
    // Gets File Names
    $name = $dirArray[$index];
    $namehref = $dirArray[$index];
    // Gets Extensions
    $extn = findexts($dirArray[$index]);
    // Gets file size
    $size = number_format(filesize($dirArray[$index]));
    // Gets Date Modified Data
    $modtime = date("M j Y g:i A", filemtime($dirArray[$index]));
    $timekey = date("YmdHis", filemtime($dirArray[$index]));
    // Print
    if (is_dir(".{$niindex}/{$namehref}") && $namehref != ".") {
        print "<tr>\n                  <td><i class='fa fa-folder'></i></td>\n                  <td><a href='./{$namehref}'>{$namehref}</a></td>\n                  <td></td>\n                  <td></td>\n                  <td></td>\n          </tr>";
    }
    if ($extn == "nii" || $extn == "gz") {
        print "\n              <script>filenames.push('{$namehref}')</script>\n              <tr>\n                  <td><i class='icon-sagittal'></i></td>\n                  <td><a href='./{$namehref}'>{$name}</a></td>\n                  <td><a href='./{$namehref}'>{$modtime}</a></td>\n                  <td><button class='btn btn-default' onclick='changeImage(\"{$count}\")'>View</button></td>\n                  <td><a href='http://neurosynth.org/decode/?url={$base}{$niindex}{$namehref}' target='_blank'><button class='btn btn-default'>Decode</button></a></td>\n              </tr>";
        $count = $count + 1;
    }
}
?>
开发者ID:vsoch,项目名称:niindex,代码行数:31,代码来源:.niindex.php

示例8: while

$loai = "1";
while ($row = mysql_fetch_array($ress)) {
    $loai = $row[0];
}
$a->setMA_FILE($num);
$a->setKICH_THUOC_FILE($fileSize);
$a->setMA_HOA_FILE($mahoafile);
$a->setMA_LOAI_CHIA_SE("ml02");
$a->setMA_LOAI_FILE($loai);
$a->setMA_THU_MUC($matm);
$a->setMAT_KHAU_CS_FILE("");
$a->setSO_LUOT_DOWN("0");
$a->setTEN_FILE($fileName);
$a->setTRANG_THAI("active");
$a->themfile();
// 0 for false... and 1 for true
if (!$fileTmpLoc) {
    // if file not chosen
    echo "ERROR: Please browse for a file before clicking the upload button.";
    exit;
}
if (move_uploaded_file($fileTmpLoc, "file/{$num}." . findexts($fileName))) {
    echo "complete";
} else {
    echo "move_uploaded_file function failed";
}
?>

wserqwrqwrwqerqwe

132erq2
开发者ID:long111306,项目名称:Du-an-1,代码行数:31,代码来源:file_upload_parser.php

示例9: fwrite

fwrite($fh, "\n");
fwrite($fh, $str2);
fwrite($fh, "\n");
fclose($fh);
$upload_path = '../temp/';
// The place the files will be uploaded to (currently a 'files' directory).
$ran = "input_file.";
function findexts($filename)
{
    $filename = strtolower($filename);
    $exts = split("[/\\.]", $filename);
    $n = count($exts) - 1;
    $exts = $exts[$n];
    return $exts;
}
$ext = findexts($_FILES['input_file']['name']);
if ($ext != "txt") {
    die('The extension of the file should be .txt');
}
// Check if we can upload to the specified path, if not DIE and inform the user.
if (!is_writable($upload_path)) {
    die('You cannot upload to the specified directory, please CHMOD it to 777.');
}
$upload_path = $upload_path . $ran . $ext;
if (move_uploaded_file($_FILES['input_file']['tmp_name'], $upload_path)) {
    echo "The file has been uploaded as " . $ran . $ext;
} else {
    echo "Sorry, there was a problem uploading your file.";
}
unset($output);
exec("/var/www/html/VirtualLabs/experiments/exp_2/c_files/load_inputs_expt_3_1 </var/www/html/VirtualLabs/experiments/exp_2/temp/tempFile", $output, $result);
开发者ID:vlabiitd,项目名称:ecelab-iitd,代码行数:31,代码来源:expt_2_form_3c.php

示例10: dechex

            $e[$i] = dechex($e[$i] <= 0 ? 0 : ($e[$i] >= 255 ? 255 : $e[$i]));
        }
        for ($i = 0; $i < 3; $i++) {
            $out .= (strlen($e[$i]) < 2 ? '0' : '') . $e[$i];
        }
        $out = strtoupper($out);
    } else {
        $out = false;
    }
    return $out;
}
$file = filter_var($_GET['_img'], FILTER_VALIDATE_URL);
if (!$file) {
    exit;
}
$ext = findexts($file);
if ($ext == 'jpg' || $ext == 'jpeg') {
    $img = imagecreatefromjpeg($file);
} elseif ($ext == 'gif') {
    $img = imagecreatefromgif($file);
} elseif ($ext == 'png') {
    $img = imagecreatefrompng($file);
} else {
    exit;
}
$max_width = 325;
$max_height = 300;
$colsize = 650 / 26;
$columns = 26;
$rows = 15;
$low_width = $max_width / $columns;
开发者ID:unnes,项目名称:deerkins,代码行数:31,代码来源:deerimg.php

示例11: BLBlobs

$blBlobs = new BLBlobs();
include_once getcwd() . "/include/imagehandler.php";
$upload_name = "Filedata";
//image uploaden + naar tabel wegschrijven
if (!empty($_FILES[$upload_name])) {
    if (findexts($_FILES[$upload_name]['name']) == "jpg" || findexts($_FILES[$upload_name]['name']) == "jpeg" || findexts($_FILES[$upload_name]['imagename']) == "gif" || findexts($_FILES[$upload_name]['name']) == "png") {
        $file = $_POST["CARID"] . "_" . strtolower(str_replace(" ", "_", $_FILES[$upload_name]['name']));
        $path = getcwd() . "/pictures/";
        //large
        $errorim = upload($_FILES[$upload_name]['tmp_name'], $path, $file, 1600, 1600);
        chmod($path . $file, 0777);
        //class
        if ($errorim[0] == true) {
            //Insert blob in table
            $blobId = $blBlobs->uploadBlobs($path . $file);
            $carpicture = new CarPicture(0, str_replace("." . findexts($file), "", $file), findexts($file), $_POST["CARID"], $blobId);
            $carpicture->setId($blCarPicture->insertCarPicture($carpicture));
            $car = $blCar->getCar($_POST["CARID"]);
            //default
            if ($car->getDefaultPictureId() == null) {
                $car->setDefaultPictureId($carpicture->getId());
                $blCar->updateCar($car);
            }
            //pictureorder
            $max = $blPictureOrder->getMaxPictureOrderByCar($car->getId()) + 1;
            $pictureorder = new PictureOrder(0, $max, $car->getId(), $carpicture->getId());
            $blPictureOrder->insertPictureOrder($pictureorder);
            //success
            //HandleError('<span style="color:green">' . $file . ' saved!</span><br />');
            $carpicturelist[] = $carpicture;
        } else {
开发者ID:janb87,项目名称:media-cars,代码行数:31,代码来源:uploadimage.php

示例12: findexts

 function findexts($filename)
 {
     return strtolower(pathinfo($filename, PATHINFO_EXTENSION));
 }
 $etape = 1;
 $addimage = '';
 if (!empty($_POST)) {
     $etape = 3;
 }
 $errormessage = _tr('Wrong format');
 if (isset($_FILES["file"])) {
     if ($_FILES["file"]["size"] > 10000000) {
         $errormessage = _tr('Image too Big');
     }
     $allowedExts = array("jpg", "jpeg", "gif", "png");
     $extension = findexts($_FILES["file"]["name"]);
     if (($_FILES["file"]["type"] == "image/gif" || $_FILES["file"]["type"] == "image/jpeg" || $_FILES["file"]["type"] == "image/png" || $_FILES["file"]["type"] == "image/pjpeg" || $_FILES["file"]["type"] == "application/octet-stream") && $_FILES["file"]["size"] < 10000000 && in_array($extension, $allowedExts)) {
         if ($_FILES["file"]["error"] > 0) {
             echo "Return Code: " . $_FILES["file"]["error"] . "<br>";
             $errormessage = _tr('Bad picture') . ' ' . $_FILES["file"]["error"];
         } else {
             if (file_exists("../files/temp/" . $_FILES["file"]["name"])) {
                 echo $_FILES["file"]["name"] . " already exists. ";
                 $errormessage = $_FILES["file"]["name"] . ' ' . _tr('already exists');
             } else {
                 move_uploaded_file($_FILES["file"]["tmp_name"], "../files/full/" . date("Ymd-His.") . $extension);
                 $filename = "../files/full/" . date("Ymd-His.") . $extension;
                 /*
                 $addimage = "upload/gallery/" . date("Ymd-His.").$extension;
                 $thumbimage600 = "upload/600/" . date("Ymd-His.").$extension;
                 $thumbimage300 = "upload/300/" . date("Ymd-His.").$extension;
开发者ID:ChrisLefevre,项目名称:Swalize-Framework,代码行数:31,代码来源:uploader.php

示例13: krsort

    }
}
krsort($files);
$dirArray = array_values($files);
//loop through the array of files
for ($index = 0; $index < count($dirArray); $index++) {
    $file_name = $dirArray[$index];
    $file_path = str_replace(" ", "%20", $save_dir . $dirArray[$index]);
    $file_size = size_readable(filesize($save_dir . $dirArray[$index]));
    $file_modtime = strftime('%c', filemtime($save_dir . $dirArray[$index]));
    $file_new = $index === 0 && $action_save && $scanner_ok && time() - filemtime($save_dir . $dirArray[$index]) <= 60;
    if (!$do_file_timezone) {
        $file_modtime = str_replace(array(' CET', ' CEST'), '', $file_modtime);
    }
    //file type and category
    $file_extention = findexts($dirArray[$index]);
    $file_category = '';
    switch ($file_extention) {
        case "bmp":
            $file_extention = $lang[$lang_id][47];
            $file_category = "image";
            break;
        case "jpg":
        case "jpeg":
            $file_extention = $lang[$lang_id][44];
            $file_category = "image";
            break;
        case "pdf":
            $file_extention = $lang[$lang_id][43];
            $file_category = "document";
            break;
开发者ID:anomen-s,项目名称:php-sane,代码行数:31,代码来源:files.php

示例14: upload_files

function upload_files(&$resp)
{
    $output_dir = codopm::$upload_path . 'client/uploads/';
    $file_size = 0;
    $valid_exts = codopm::$config['valid_exts'];
    $file_size_limit = codopm::$config['per_filesize_limit'] * 1024;
    //2 MB
    $total_file_size_limit = codopm::$config['total_filesize_limit'] * 1024;
    //10MB
    $file_ext = explode(",", $valid_exts);
    $file_names = array();
    foreach ($_FILES as $file) {
        $file_uploaded_ext = strtolower(findexts($file["name"]));
        if (!in_array($file_uploaded_ext, $file_ext)) {
            $resp->has_error = true;
            $resp->msg = "file extension not supported";
        } else {
            if ($file["size"] > $file_size_limit) {
                $resp->has_error = true;
                $resp->msg = "file size cannot be greater than {$file_size_limit} KB";
            } else {
                if ($file["error"] > 0) {
                    $resp->has_error = true;
                    $resp->msg = "file could not be uploaded [" . $_FILES["myfile"]["error"] . "]";
                } else {
                    if ($file["error"] == 0 && $file_size < $total_file_size_limit) {
                        $file_size += $file['size'];
                        $uname = time() . rand(22, 333) . "." . $file_uploaded_ext;
                        move_uploaded_file($file["tmp_name"], $output_dir . $uname);
                        $file_names[] = array("name" => strip_tags($file["name"]), "uname" => $uname);
                    } else {
                        $resp->has_error = true;
                        $resp->msg = "Total file size exceeds {$total_file_size_limit} KB";
                    }
                }
            }
        }
    }
    return $file_names;
}
开发者ID:kertkulp,项目名称:php-ruhmatoo-projekt,代码行数:40,代码来源:codopm.php

示例15: findexts

<?php 
include '../_paths.php';
//$destination="Recordedfiles/".$_GET["filename"];
$source = $fmsRootPath . "userlist/" . $_GET["filename"];
//$destination="E:/dpk/Recordedfiles/".$_GET["filename"];
$teacher = $_GET["teachername"];
function findexts($filename)
{
    $filename = strtolower($filename);
    $exts = split("[/\\.]", $filename);
    $n = count($exts) - 1;
    $exts = $exts[$n];
    return $exts;
}
$ext = findexts($_GET["filename"]);
$ran = date("m.d.y");
$ran3 = time();
$ran = $ran . "_" . $ran3;
$ran2 = $ran . ".";
$target = "Recordedfiles/";
$target = $target . $teacher . $ran2 . $ext;
echo "\n\n\n\n\n";
echo $ext;
echo "\n\n\n\n\n";
echo $target;
echo "\n\n\n\n\n";
//echo $ext;
echo "\n\n\n\n\n";
//if(rename($_GET["filename"], $target))
//{
开发者ID:aview,项目名称:aview-content-php,代码行数:30,代码来源:renamer.php


注:本文中的findexts函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。