• PHP Video Tutorials

PHP - Function Strstr



Syntax

strstr(string,search,before_search)

Definition and Usage

It is used to find the first occurrence of a string

Return Values

It returns the rest of string or else false if string is not found

Parameters

Sr.No Parameters & Description
1

string

It specifies the string to search

2

search

It specifies the string to search

3

before_search

A boolean value whose default is "false". If set to "true", it returns the part of the string before the first occurrence of the search parameter.

Example

Try out the following example

<?php
   echo strstr("kittuprasasd",111);
?>
php_function_reference.htm
Advertisements