• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getFileExt函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: isValidExt

/**
 * check if a file extension is permitted
 *
 * @param string $filePath
 * @param array $validExts
 * @param array $invalidExts
 * @return boolean
 */
function isValidExt($filePath, $validExts, $invalidExts = array())
{
    $tem = array();
    if (sizeof($validExts)) {
        foreach ($validExts as $k => $v) {
            $tem[$k] = strtolower(trim($v));
        }
    }
    $validExts = $tem;
    $tem = array();
    if (sizeof($invalidExts)) {
        foreach ($invalidExts as $k => $v) {
            $tem[$k] = strtolower(trim($v));
        }
    }
    $invalidExts = $tem;
    if (sizeof($validExts) && sizeof($invalidExts)) {
        foreach ($validExts as $k => $ext) {
            if (array_search($ext, $invalidExts) !== false) {
                unset($validExts[$k]);
            }
        }
    }
    if (sizeof($validExts)) {
        if (array_search(strtolower(getFileExt($filePath)), $validExts) !== false) {
            return true;
        } else {
            return false;
        }
    } elseif (array_search(strtolower(getFileExt($filePath)), $invalidExts) === false) {
        return true;
    } else {
        return false;
    }
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:43,代码来源:function.base.php


示例2: directoryToArray

function directoryToArray($abs, $directory, $filterMap = NULL)
{
    $assets = array();
    $dir = $abs . $directory;
    if ($handle = opendir($dir)) {
        while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != "..") {
                if (!is_dir($dir . "/" . $file)) {
                    if ($filterMap) {
                        if (in_array(getFileExt($file), $filterMap)) {
                            if (fileIgnore($file)) {
                                $assets[basename($file)] = get_stylesheet_directory_uri() . $directory . $file;
                            }
                        }
                    } else {
                        if (fileIgnore($file)) {
                            $assets[basename($file)] = get_stylesheet_directory_uri() . $directory . $file;
                        }
                    }
                }
            }
        }
        closedir($handle);
    }
    return $assets;
}
开发者ID:Rostyk27,项目名称:themewp,代码行数:26,代码来源:assets.php


示例3: init

 public static function init($image, $width = 120, $height = 120, $isCheck = false)
 {
     if (!is_file($image)) {
         return false;
     }
     //处理缩略图文件名
     $imageExt = getFileExt($image);
     $toImage = str_replace('.' . $imageExt, '_' . $width . '.' . $imageExt, $image);
     if (is_file(ROOT . $toImage)) {
         return $toImage;
     } elseif ($isCheck) {
         return false;
     }
     //获取图片信息
     self::imageInfo($image);
     //验证是否获取到信息
     if (empty(self::$image_w) || empty(self::$image_h) || empty(self::$image_ext)) {
         return false;
     }
     //如果图片比设置的小就直接返回
     if (self::$image_w <= $width && self::$image_h <= $height) {
         return $image;
     }
     //以原图做画布
     $a = 'imagecreatefrom' . self::$image_ext;
     $original = $a($image);
     if (self::$image_w > self::$image_h) {
         //宽 > 高
         $crop_x = (self::$image_w - self::$image_h) / 2;
         $crop_y = 0;
         $crop_w = $crop_h = self::$image_h;
     } else {
         $crop_x = 0;
         $crop_y = (self::$image_h - self::$image_w) / 2;
         $crop_w = $crop_h = self::$image_w;
     }
     if (!$height) {
         $height = floor(self::$image_h / (self::$image_w / $width));
         $crop_x = 0;
         $crop_y = 0;
         $crop_w = self::$image_w;
         $crop_h = self::$image_h;
     }
     $litter = imagecreatetruecolor($width, $height);
     if (!imagecopyresampled($litter, $original, 0, 0, $crop_x, $crop_y, $width, $height, $crop_w, $crop_h)) {
         return false;
     }
     //保存图片
     $keep = 'image' . self::$image_ext;
     $keep($litter, ROOT . $toImage);
     //关闭图片
     imagedestroy($original);
     imagedestroy($litter);
     return $toImage;
 }
开发者ID:sdgdsffdsfff,项目名称:51jhome_customerservice,代码行数:55,代码来源:thumb.class.php


示例4: readJson

/**
 * 解析json文件
 *
 * @param  {string} $filePath 文件路径
 * @param  {boolean} $isRelatedToMock 是否相对于mock根目录
 * @return {Object}           json对象
 */
function readJson($filePath, $isRelatedToMock = false)
{
    $ext = getFileExt($filePath);
    if (empty($ext)) {
        $filePath = $filePath . '.json';
    }
    if ($isRelatedToMock) {
        $filePath = Conf::$rootDir . '/mock/' . $filePath;
    } else {
        $filePath = Conf::$scriptDir . '/' . $filePath;
    }
    $json = file_get_contents($filePath);
    return json_decode($json, true);
}
开发者ID:asd123freedom,项目名称:DragAndDrop,代码行数:21,代码来源:Util.php


示例5: recurseDirectoryWithFilter

function recurseDirectoryWithFilter(&$arrItems, $directory, $recursive, &$filterMap)
{
    if ($handle = opendir($directory)) {
        while (false !== ($file = readdir($handle))) {
            if ($file != "." && $file != "..") {
                if (is_dir($directory . $file)) {
                    if ($recursive) {
                        recurseDirectoryWithFilter($arrItems, $directory . $file . "/", $recursive, $filterMap);
                    }
                } else {
                    if (isset($filterMap[getFileExt($file)])) {
                        $arrItems[] = $directory . $file;
                    }
                }
            }
        }
        closedir($handle);
    }
    return $arrItems;
}
开发者ID:hiroyalty,项目名称:mhealth,代码行数:20,代码来源:getFilesInDirectoryAsArray.php


示例6: getCssFileList

function getCssFileList($cssDir)
{
    $cssDir = rtrim($cssDir, '\\/') . '/';
    $fileList = array();
    //array('源css文件', '源css文件2'...));
    if (is_dir($cssDir)) {
        $dh = opendir($cssDir);
        while (($file = readdir($dh)) !== false) {
            if ($file != '.' && $file != '..') {
                if (is_dir($cssDir . $file)) {
                    $fileList2 = getCssFileList($cssDir . $file);
                    $fileList = array_merge($fileList, $fileList2);
                } else {
                    if (getFileExt($file) == 'css') {
                        $fileList[] = $cssDir . $file;
                    }
                }
            }
        }
        closedir($dh);
    }
    return $fileList;
}
开发者ID:shaokr,项目名称:FN-toop,代码行数:23,代码来源:php_csstest.php


示例7: uniqid

 $history->add($sessionImageInfo);
 if (CONFIG_SYS_DEMO_ENABLE) {
     //demo only
     if (isset($originalSessionImageInfo) && sizeof($originalSessionImageInfo)) {
         $imagePath = $sessionDir . $originalSessionImageInfo['info']['name'];
     } else {
         $imagePath = $sessionDir . uniqid(md5(time())) . "." . getFileExt($_POST['path']);
     }
 } else {
     if ($isSaveAsRequest) {
         //save as request
         //check save to folder if exists
         if (isset($_POST['save_to']) && strlen($_POST['save_to'])) {
             $imagePath = $originalImage;
         } else {
             $imagePath = addTrailingSlash(backslashToSlash($_POST['save_to'])) . $_POST['new_name'] . "." . getFileExt($_POST['path']);
         }
         if (!file_exists($_POST['save_to']) || !is_dir($_POST['save_to'])) {
             $error = IMG_SAVE_AS_FOLDER_NOT_FOUND;
         } elseif (file_exists($imagePath)) {
             $error = IMG_SAVE_AS_NEW_IMAGE_EXISTS;
         } elseif (!preg_match("/^[a-zA-Z0-9_\\- ]+\$/", $_POST['new_name'])) {
             $error = IMG_SAVE_AS_ERR_NAME_INVALID;
         }
     } else {
         //save request
         $imagePath = $originalImage;
     }
 }
 if ($image->saveImage($imagePath)) {
     if (CONFIG_SYS_DEMO_ENABLE) {
开发者ID:naneri,项目名称:Osclass,代码行数:31,代码来源:ajax_image_save.php


示例8: _createDocs

 function _createDocs(&$man, &$input)
 {
     $result = new Moxiecode_ResultSet("status,fromfile,tofile,message");
     $config = $man->getConfig();
     if (!$man->isToolEnabled("createdoc", $config)) {
         trigger_error("{#error.no_access}", FATAL);
         die;
     }
     for ($i = 0; isset($input["frompath" . $i]) && isset($input["toname" . $i]); $i++) {
         $fromFile =& $man->getFile($input["frompath" . $i]);
         $ext = getFileExt($fromFile->getName());
         $toFile =& $man->getFile($input["topath" . $i], $input["toname" . $i] . '.' . $ext);
         $toConfig = $toFile->getConfig();
         if (checkBool($toConfig['general.demo'])) {
             $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.demo}");
             continue;
         }
         if ($man->verifyFile($toFile, "createdoc") < 0) {
             $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), $man->getInvalidFileMsg());
             continue;
         }
         if (!$toFile->canWrite()) {
             $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.no_write_access}");
             continue;
         }
         if (!checkBool($toConfig["filesystem.writable"])) {
             $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.no_write_access}");
             continue;
         }
         if (!$fromFile->exists()) {
             $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.template_missing}");
             continue;
         }
         if ($fromFile->copyTo($toFile)) {
             // Replace title
             $fields = $input["fields"];
             // Replace all fields
             if ($fields) {
                 // Read all data
                 $stream = $toFile->open('r');
                 $fileData = $stream->readToEnd();
                 $stream->close();
                 // Replace fields
                 foreach ($fields as $name => $value) {
                     $fileData = str_replace('${' . $name . '}', htmlentities($value), $fileData);
                 }
                 // Write file data
                 $stream = $toFile->open('w');
                 $stream->write($fileData);
                 $stream->close();
             }
             $result->add("OK", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#message.createdoc_success}");
         } else {
             $result->add("FAILED", $man->encryptPath($fromFile->getAbsolutePath()), $man->encryptPath($toFile->getAbsolutePath()), "{#error.createdoc_failed}");
         }
     }
     return $result->toArray();
 }
开发者ID:anunay,项目名称:stentors,代码行数:58,代码来源:FileManagerPlugin.php


示例9: normalizeFileType

// We check if the data was submitted
if ($file && $type) {
    // We define some stuffs
    $type = normalizeFileType($type);
    $dir = JAPPIX_BASE . '/app/' . $type . '/';
    $path = $dir . $file;
    // Read request headers
    $if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? trim($_SERVER['HTTP_IF_MODIFIED_SINCE']) : null;
    $if_modified_since = $if_modified_since ? strtotime($if_modified_since) : null;
    // Define the real type if this is a "store" file
    if ($type == 'store') {
        // Rewrite path
        $dir = JAPPIX_BASE . '/store/';
        $path = $dir . $file;
        // Extract the file extension
        switch (getFileExt($file)) {
            // CSS file
            case 'css':
                $type = 'stylesheets';
                break;
                // JS file
            // JS file
            case 'js':
                $type = 'javascripts';
                break;
                // Audio file
            // Audio file
            case 'ogg':
            case 'oga':
            case 'mp3':
                $type = 'sounds';
开发者ID:neurolit,项目名称:jappix,代码行数:31,代码来源:get.php


示例10: getFileExt

echo IMG_LBL_SAVE_AS;
?>
</th>
          </tr>
        </thead>
        <tbody>
        	<tr>
          	<th>
            	<label><?php 
echo IMG_LBL_NEW_NAME;
?>
</label>
            </th>
            <td>
            	<input type="text" id="new_name" class="input" name="new_name" value="" />&nbsp;.<?php 
echo getFileExt($path);
?>
            </td>
          </tr>
          <tr>
          	<th>
            	<label><?php 
echo IMG_LBL_SAVE_TO;
?>
</label>
            </th>
            <td>
            	<select class="input" name="save_to" id="save_to"></select>
            </td>
          </tr>
          <tr>
开发者ID:rip-projects,项目名称:judge,代码行数:31,代码来源:ajax_image_editor.php


示例11: get_src_img_object

function get_src_img_object($src_dir)
{
    $src;
    if (getFileExt($src_dir) == "gif") {
        $src = ImageCreateFromGIF($src_dir);
    } else {
        if (getFileExt($src_dir) == "jpg" || getFileExt($src_dir) == "jpeg") {
            $src = ImageCreateFromJPEG($src_dir);
        } else {
            if (getFileExt($src_dir) == "png") {
                $src = ImageCreateFromPNG($src_dir);
            }
        }
    }
    return $src;
}
开发者ID:loneblue,项目名称:geonkorea,代码行数:16,代码来源:mlib.php


示例12: die

    die("alert('You need to run the installer or rename/remove the \"install\" directory.');");
}
error_reporting(E_ALL ^ E_NOTICE);
require_once "../includes/general.php";
require_once '../classes/Utils/JSCompressor.php';
$compress = true;
// Some PHP installations seems to
// output the dir rather than the current file here
// it gets to /js/ instead of /js/index.php
$baseURL = $_SERVER["PHP_SELF"];
// Hmm, stange?
if (strpos($baseURL, 'default.php/') > 0 || strpos($baseURL, 'index.php/') > 0) {
    $baseURL = $_SERVER["SCRIPT_NAME"];
}
// Is file, get dir
if (getFileExt($baseURL) == "php") {
    $baseURL = dirname($baseURL);
}
// Remove trailing slash if it has any
if ($baseURL && $baseURL[strlen($baseURL) - 1] == '/') {
    $baseURL = substr($baseURL, 0, strlen($baseURL) - 1);
}
// Remove any weird // or /// items
$baseURL = preg_replace('/\\/+/', '/', $baseURL);
if ($compress) {
    $compressor = new Moxiecode_JSCompressor(array('expires_offset' => 3600 * 24 * 10, 'disk_cache' => true, 'cache_dir' => '_cache', 'gzip_compress' => true, 'remove_whitespace' => true, 'charset' => 'UTF-8'));
    // Compress these
    $compressor->addFile('mox.js');
    $compressor->addFile('gz_loader.js');
    $compressor->addContent("mox.defaultDoc = 'index.php';");
    $compressor->addContent('mox.findBaseURL(/(\\/js\\/|\\/js\\/index\\.php)$/);');
开发者ID:oaki,项目名称:demoshop,代码行数:31,代码来源:index.php


示例13: getimagesize

$tmp = $_FILES['avatar']['tmp_name'];
$ecode = 0;
// check filesize
if (filesize($tmp) > $config->get('avatar_size') * 1000) {
    $ecode = 1;
}
// check height & width
$size = getimagesize($tmp);
if ($size[0] > $config->get('avatar_height')) {
    $ecode = 2;
}
if ($size[1] > $config->get('avatar_width')) {
    $ecode = 3;
}
// check filetype
$ext = getFileExt($_FILES['avatar']['name']);
$ext = strtolower($ext);
$validExt = strtolower($config->get('avatar_types'));
$validExt = explode(',', $validExt);
if (!in_array($ext, $validExt)) {
    $ecode = 4;
}
if ($ecode > 0) {
    unlink($tmp);
    jsRedirect('usercp.php?action=avatars&ecode=' . $ecode);
}
// everything is good, add the avatar
$file = time() . '-' . $user->id . '.' . $ext;
move_uploaded_file($tmp, './avatars/' . $file);
$id = $user->id;
$type = $_POST['type'];
开发者ID:nickfun,项目名称:newlifeblogger,代码行数:31,代码来源:avatar_upload.php


示例14: switch

    switch ($mimetype) {
        case 'image/gif':
            $ext = 'gif';
            break;
        case 'image/jpeg':
            $ext = 'jpg';
            break;
        case 'image/png':
            $ext = 'png';
            break;
        default:
            $ext = null;
    }
    // Get the file extension if could not get it through MIME
    if (!$ext) {
        $ext = getFileExt($file_path);
    }
    if ($ext == 'gif' || $ext == 'jpg' || $ext == 'png') {
        // Resize the image
        resizeImage($file_path, $ext, 1024, 1024);
        // Copy the image
        $thumb = $file_path . '_thumb.' . $ext;
        copy($file_path, $thumb);
        // Create the thumbnail
        if (resizeImage($thumb, $ext, 140, 105)) {
            $thumb_xml = '<thumb>' . htmlspecialchars($location . 'store/share/' . $md5 . '_thumb.' . $ext) . '</thumb>';
        }
    }
    // Return the path to the file
    exit('<jappix xmlns=\'jappix:file:post\'>
		<href>' . htmlspecialchars($location . '?m=download&file=' . $md5 . '&key=' . $key . '&ext=.' . $ext) . '</href>
开发者ID:ntrrgc,项目名称:jappix,代码行数:31,代码来源:file-share.php


示例15: echo

          	<th colspan="2"><?php echo IMG_LBL_SAVE_AS; ?></th>
          </tr>
        </thead>
        <tbody>
        	<tr>
          	<th>
            	<label><?php echo IMG_LBL_NEW_NAME; ?></label>
            </th>
            <td>
            	<input type="text" id="new_name" class="input" name="new_name" value="" />
              &nbsp;.&nbsp;<select id="ext" name="ext">
              <?php
								foreach(getValidTextEditorExts() as $v)
								{
									?>
									<option value="<?php echo $v; ?>" <?php echo (strtolower($v) == strtolower(getFileExt($path))?'selected':''); ?>><?php echo $v; ?></option>
									<?php
								}
							?>
              </select>
            </td>
          </tr>
          <tr>
          	<th>
            	<label><?php echo IMG_LBL_SAVE_TO; ?></label>
            </th>
            <td>
            	<select class="input" name="save_to" id="save_to">
              	
              </select>
            </td>
开发者ID:Ting-Article,项目名称:Interview,代码行数:31,代码来源:ajax_text_editor.php


示例16: checkFile

function checkFile($filename)
{
    $ext = getFileExt($filename);
    $result_boolean = false;
    if (!eregi("htm", $ext) && !eregi("php", $ext)) {
        $result_boolean = true;
    }
    return $result_boolean;
}
开发者ID:loneblue,项目名称:geonkorea,代码行数:9,代码来源:sub_mlib.php


示例17: build_blocks

function build_blocks($items, $folder)
{
    global $ignore_file_list, $ignore_ext_list, $sort_by, $toggle_sub_folders;
    $objects = array();
    $objects['directories'] = array();
    $objects['files'] = array();
    foreach ($items as $c => $item) {
        if ($item == ".." or $item == ".") {
            continue;
        }
        // IGNORE FILE
        if (in_array($item, $ignore_file_list)) {
            continue;
        }
        if ($folder) {
            $item = "{$folder}/{$item}";
        }
        $file_ext = getFileExt($item);
        // IGNORE EXT
        if (in_array($file_ext, $ignore_ext_list)) {
            continue;
        }
        // DIRECTORIES
        if (is_dir($item)) {
            $objects['directories'][] = $item;
            continue;
        }
        // FILE DATE
        $file_time = date("U", filemtime($item));
        // FILES
        $objects['files'][$file_time . "-" . $item] = $item;
    }
    foreach ($objects['directories'] as $c => $file) {
        display_block($file);
        if ($toggle_sub_folders) {
            $sub_items = (array) scandir($file);
            if ($sub_items) {
                echo "<div class='sub' data-folder=\"{$file}\">";
                build_blocks($sub_items, $file);
                echo "</div>";
            }
        }
    }
    // SORT BEFORE LOOP
    if ($sort_by == "date_asc") {
        ksort($objects['files']);
    } elseif ($sort_by == "date_desc") {
        krsort($objects['files']);
    } elseif ($sort_by == "name_asc") {
        natsort($objects['files']);
    } elseif ($sort_by == "name_desc") {
        arsort($objects['files']);
    }
    foreach ($objects['files'] as $t => $file) {
        $fileExt = getFileExt($file);
        if (in_array($file, $ignore_file_list)) {
            continue;
        }
        if (in_array($fileExt, $ignore_ext_list)) {
            continue;
        }
        display_block($file);
    }
}
开发者ID:blckshrk,项目名称:file-directory-list,代码行数:64,代码来源:index.php


示例18: getFileExt

		<div id="windowSaveAs" class="jqmWindow" style="display:none">
    	<a href="#" class="jqmClose" id="windowSaveClose"><?php echo LBL_ACTION_CLOSE; ?></a>
      <form id="formSaveAs" name="formSaveAs" action="" method="post">
    	<table class="tableForm" cellpadding="0" cellspacing="0">
      	<thead>
        	<tr>
          	<th colspan="2"><?php echo IMG_LBL_SAVE_AS; ?></th>
          </tr>
        </thead>
        <tbody>
        	<tr>
          	<th>
            	<label><?php echo IMG_LBL_NEW_NAME; ?></label>
            </th>
            <td>
            	<input type="text" id="new_name" class="input" name="new_name" value="" />&nbsp;.<?php echo getFileExt($path); ?>
            </td>
          </tr>
          <tr>
          	<th>
            	<label><?php echo IMG_LBL_SAVE_TO; ?></label>
            </th>
            <td>
            	<select class="input" name="save_to" id="save_to"></select>
            </td>
          </tr>
          <tr>
          	<th>&nbsp;
            </th>
            <td>
            <span class="comments">*</span>
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:ajax_image_editor.php


示例19: readfile

    readfile($file_path);
    unlink($file_path);
} else {
    if (isset($_FILES['file']) && !empty($_FILES['file']) && (isset($_POST['id']) && !empty($_POST['id'])) && (isset($_POST['location']) && !empty($_POST['location']))) {
        header('Content-Type: text/xml; charset=utf-8');
        // Get the file name
        $tmp_filename = $_FILES['file']['tmp_name'];
        $filename = $_FILES['file']['name'];
        // Get the location
        if (HOST_UPLOAD) {
            $location = HOST_UPLOAD . '/';
        } else {
            $location = $_POST['location'];
        }
        // Get the file new name
        $ext = getFileExt($filename);
        $new_name = preg_replace('/(^)(.+)(\\.)(.+)($)/i', '$2', $filename);
        // Define some vars
        $name = sha1(time() . $filename);
        $path = JAPPIX_BASE . '/tmp/send/' . $name . '.' . $ext;
        // Forbidden file?
        if (!isSafeAllowed($filename) || !isSafeAllowed($name . '.' . $ext)) {
            exit('<jappix xmlns=\'jappix:file:send\'>
    <error>forbidden-type</error>
    <id>' . htmlspecialchars($_POST['id']) . '</id>
</jappix>');
        }
        // File upload error?
        if (!is_uploaded_file($tmp_filename) || !move_uploaded_file($tmp_filename, $path)) {
            exit('<jappix xmlns=\'jappix:file:send\'>
    <error>move-error</error>
开发者ID:neurolit,项目名称:jappix,代码行数:31,代码来源:send.php


示例20: array

         $logos_arr_4_name = $_FILES['logo_own_4_location']['name'];
         $logos_arr_4_tmp = $_FILES['logo_own_4_location']['tmp_name'];
     }
     // File infos array
     $logos = array(array($logos_arr_1_name, $logos_arr_1_tmp, JAPPIX_BASE . '/store/logos/desktop_home.png'), array($logos_arr_2_name, $logos_arr_2_tmp, JAPPIX_BASE . '/store/logos/desktop_app.png'), array($logos_arr_3_name, $logos_arr_3_tmp, JAPPIX_BASE . '/store/logos/mobile.png'), array($logos_arr_4_name, $logos_arr_4_tmp, JAPPIX_BASE . '/store/logos/mini.png'));
     // Check for errors
     $logo_error = false;
     $logo_not_png = false;
     $logo_anything = false;
     foreach ($logos as $sub_array) {
         // Nothing?
         if (!$sub_array[0] || !$sub_array[1]) {
             continue;
         }
         // Not an image?
         if (getFileExt($sub_array[0]) != 'png') {
             $logo_not_png = true;
             continue;
         }
         // Upload error?
         if (!move_uploaded_file($sub_array[1], $sub_array[2])) {
             $logo_error = true;
             continue;
         }
         $logo_anything = true;
     }
     // Not an image?
     if ($logo_not_png) {
         ?>
 <p class="info smallspace fail"><?php 
         _e("This is not a valid image, please use the PNG format!");
开发者ID:neurolit,项目名称:jappix,代码行数:31,代码来源:post-design.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getFileExtension函数代码示例发布时间:2022-05-15
下一篇:
PHP getFileContents函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap