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


PHP CoreUtils::length方法代码示例

本文整理汇总了PHP中CoreUtils::length方法的典型用法代码示例。如果您正苦于以下问题:PHP CoreUtils::length方法的具体用法?PHP CoreUtils::length怎么用?PHP CoreUtils::length使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CoreUtils的用法示例。


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

示例1: checkStringLength

 static function checkStringLength($value, $range, &$code)
 {
     return $code = self::_numberInRange(CoreUtils::length($value), $range);
 }
开发者ID:ponydevs,项目名称:MLPVC-RR,代码行数:4,代码来源:Input.php

示例2: __construct

 /**
  * Construct an instance of the class
  *
  * @param string $pattern
  * @param string $modifiers
  * @param string $delimiter
  *
  * @return RegExp
  */
 public function __construct(string $pattern, string $modifiers = '', string $delimiter = '~')
 {
     $this->_delimiter = $delimiter[0] ?? '~';
     $this->_pattern = $pattern;
     $this->_modifiers = CoreUtils::length($modifiers) ? $modifiers : '';
 }
开发者ID:ponydevs,项目名称:MLPVC-RR,代码行数:15,代码来源:RegExp.php

示例3: processUploadedImage

 /**
  * Function to process uploaded images
  *
  * Checks the $_FILES array for an item named $key,
  *  checks if file is an image, and it's mime type
  *  can be found in $allowedMimeTypes, and finally
  *  checks if the size is at least $minwidth by $minheight,
  *  then moves it to the requested $path.
  *
  * @param string $key
  * @param string $path
  * @param array|null $allowedMimeTypes
  * @param int $minwidth
  * @param int|null $minheight
  *
  * @return null
  */
 static function processUploadedImage($key, $path, $allowedMimeTypes, $minwidth, $minheight = null)
 {
     if (!isset($minheight)) {
         $minheight = $minwidth;
     }
     if (!isset($_FILES[$key])) {
         return self::grabImage($path, $allowedMimeTypes, $minwidth, $minheight);
     }
     $file = $_FILES[$key];
     $tmp = $file['tmp_name'];
     if (CoreUtils::length($tmp) < 1) {
         Response::fail('File upload failed; Reason unknown');
     }
     list($width, $height) = Image::checkType($tmp, $allowedMimeTypes);
     CoreUtils::createUploadFolder($path);
     if (!move_uploaded_file($tmp, $path)) {
         @unlink($tmp);
         Response::fail('File upload failed; Writing image file was unsuccessful');
     }
     Image::checkSize($path, $width, $height, $minwidth, $minheight);
 }
开发者ID:ponydevs,项目名称:MLPVC-RR,代码行数:38,代码来源:CGUtils.php


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