Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Interpretation of string length functions strlen () and mb_strlen () commonly used in php

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Int strlen (string $string)

Int strlen (string $string) returns the length of the string $string if it succeeds in getting the [byte] length of the given string, or 0 if $string is empty.

Mb_strlen ()-gets the length of the string

Mixed mb_strlen (string $str [, string $encoding = mb_internal_encoding ()])

The string to check the length of $str

$encoding, which can specify character encoding, or use internal character encoding if omitted

Return value: returns the [number of characters] contained in the string str with encoding encoding, and multi-byte characters are counted as 1

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report