Home > Backend Development > PHP Problem > What is the php strlen method?

What is the php strlen method?

藏色散人
Release: 2023-03-14 06:14:01
Original
2125 people have browsed it

php The strlen method is used to return the length of a string. The syntax for using this function is "strlen(string)", where the parameter string specifies the string to be checked.

What is the php strlen method?

#The operating environment of this article: Windows7 system, PHP7.1, Dell G3 computer.

php What is the strlen method?

strlen() function returns the length of the string.

Syntax

strlen(string)
Copy after login

Note: Before PHP 5.3.0, this function treated the array as a string Array, thus returning a string of length 5 and generating an E_NOTICE level error. .

Parameter string required. Specifies the string to check.

Example

Return the length of the string "I love Shanghai!":

<?php
echo strlen("I love Shanghai!");
?>
Copy after login

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What is the php strlen method?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template