當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。