• PHP Video Tutorials

PHP - Function Strpos



Syntax

strpos(string,find,start)

Definition and Usage

It is used to find the position of first occurrence of a string inside another string.

Return Values

It returns the position of first occurrence of a string inside another string or else false if string is not found

Parameters

Sr.No Parameters & Description
1

string

It specifies string to search

2

find

It specifies string to find

3

start

It specifies specifies where to begin the search

Example

Try out the following example

<?php
   echo strpos("Tutorials point simply easy learning !","easy");
?>

This will produce following result −

23
php_function_reference.htm
Advertisements