Home  >  Article  >  Backend Development  >  what is php strpos

what is php strpos

藏色散人
藏色散人Original
2019-11-19 16:21:113577browse

what is php strpos

php What is strpos?

php strpos is a PHP built-in function. The strpos() function finds the first occurrence of a string in another string.

Note: The strpos() function is case-sensitive.

Note: This function is binary safe.

Recommended: "PHP Tutorial"

Related functions:

stripos() - Find another character in a string The position of the first occurrence of a string in a string (case-insensitive)

strripos() - Finds the position of the last occurrence of a string in another string (case-insensitive)

strrpos() - Finds the last occurrence of a string within another string (case sensitive)

Syntax

strpos(string,find,start)

Parameters

string Required. Specifies the string to search for.

find Required. Specifies the string to search for.

start Optional. Specifies where to start the search.

Return value:

Returns the position of the first occurrence of a string in another string, or returns FALSE if the string is not found.

Note: The string position starts from 0, not from 1.

Example

Find the first occurrence of "php" in the string:

77368d1f18a44029fce40385aff0556c

The above is the detailed content of what is php strpos. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:How to read text in phpNext article:How to read text in php