You are here

public static function Helper::strlen in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Helper/Helper.php \Symfony\Component\Console\Helper\Helper::strlen()

Returns the length of a string, using mb_strwidth if it is available.

Parameters

string $string The string to check its length:

Return value

int The length of the string

8 calls to Helper::strlen()
FormatterHelper::formatBlock in vendor/symfony/console/Helper/FormatterHelper.php
Formats a message as a block of text.
Helper::strlenWithoutDecoration in vendor/symfony/console/Helper/Helper.php
ProgressBar::setMaxSteps in vendor/symfony/console/Helper/ProgressBar.php
Sets the progress bar maximal steps.
ProgressHelper::generate in vendor/symfony/console/Helper/ProgressHelper.php
Generates the array map of format variables to values.
ProgressHelper::initialize in vendor/symfony/console/Helper/ProgressHelper.php
Initializes the progress helper.

... See full list

File

vendor/symfony/console/Helper/Helper.php, line 52

Class

Helper
Helper is the base class for all helper classes.

Namespace

Symfony\Component\Console\Helper

Code

public static function strlen($string) {
  if (!function_exists('mb_strwidth')) {
    return strlen($string);
  }
  if (false === ($encoding = mb_detect_encoding($string))) {
    return strlen($string);
  }
  return mb_strwidth($string, $encoding);
}