string length

    0

    63

    The code returns the length of the given string in bytes. If the $multibyte flag is set to true, then it will also return the length of the string in multibytes.

    Shortcut: stringlength

    public function length($value, $multibyte = true)
    {
      return $multibyte ? mb_strlen($value) : strlen($value);
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.