PHP function method knowledge

WBOY
Release: 2016-07-29 08:55:50
Original
1202 people have browsed it

1. The strlen() function returns the length of the string in characters.

strlen returns the length of the string. strlen("hello") displays 5

2. The strpos() function is used to retrieve the specified characters or text within the string.

strpos("hello","e") displays 1 because it starts counting from 0.

3, Valid constant names start with a character or an underscore (there is no $ sign in front of the constant name).

Note: Unlike variables, constants are automatically global throughout the entire script.

4, count() function is used to return the length (number of elements) of the array. str is the string length.

The above has introduced the knowledge of PHP function methods, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!