mb_strlen() public static method

Calls mb_substr if available and falls back to substr if not.
public static mb_strlen ( string $string ) : integer
$string string
return integer
 public function checkName($name)
 {
     if (empty($name)) {
         throw new Exception(Piwik::translate("General_PleaseSpecifyValue", "name"));
     }
     if (Common::mb_strlen($name) > 100) {
         throw new Exception(Piwik::translate("CustomAlerts_ParmeterIsTooLong", array(Piwik::translate('General_Name'), 100)));
     }
 }
示例#2
0
文件: Cloud.php 项目: piwik/piwik
 /**
  * @param $word
  * @return string
  */
 private function truncateWordIfNeeded($word)
 {
     $word = Common::unsanitizeInputValue($word);
     if (Common::mb_strlen($word) > $this->truncatingLimit) {
         return Common::mb_substr($word, 0, $this->truncatingLimit - 3) . '...';
     }
     return $word;
 }
示例#3
0
 /**
  * @param $word
  * @return string
  */
 private function truncateWordIfNeeded($word)
 {
     if (Common::mb_strlen($word) > $this->truncatingLimit) {
         return Common::mb_substr($word, 0, $this->truncatingLimit - 3) . '...';
     }
     return $word;
 }