"> " />
Easy Tutorial
❮ Php Image Type To Mime Type Func Math Lcg Value ❯

PHP strpos() Function

PHP String Reference Manual

Example

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

<?php
echo strpos("I love php, I love php too!","php");
?>

Definition and Usage

The strpos() function finds the position of the first occurrence of a string within another string (case-sensitive).

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

Note: This function is binary-safe.

Related functions:


Syntax

Parameter Description
string Required. Specifies the string to search.
find Required. Specifies the string to find.
start Optional. Specifies where to start the search.

Technical Details

Return Value: Returns the position of the first occurrence of a string within another string, or FALSE if the string is not found. Note: String positions start at 0, not 1.
PHP Version: 4+
--- ---
❮ Php Image Type To Mime Type Func Math Lcg Value ❯