PHP

PHP Menu

PHP

strpos() Function - Definition, Syntax, Parameters, Examples

Definition

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

Syntax

strpos(string, find, start)

Parameters

Parameter Description
string Required. Specifies the string to search.
find Required. Specifies the string to find.
start Optional. Specifies where to begin the search. If start is a negative number, it counts from the end of the string.

Example

<?php
echo strpos("Welcome to the PHP Tutorials! Find PHP functions here.", "PHP");

Introduction

PHP Basics

PHP Advance

PHP OOP

PHP Functions and Methods