what is php strpos

藏色散人
Release: 2023-02-28 15:14:01
Original
3623 people have browsed it

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)
Copy after login

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:

echo strpos("You love php, I love php too!","php");

?>

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

Related labels:
php
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