• PHP Video Tutorials

PHP - Function Strchr



Syntax

strchr(string,search,before_search);

Definition and Usage

It is used to searches for the first occurrence of a string inside another

Return Values

It returns the rest of string

Parameters

Sr.No Parameters & Description
1

string

It returns the string to search

2

search

It returns the string to search for

Example

Try out the following example

<?php
   echo strchr("Hello world!","world");
?>

This will produce following result −

world!
php_function_reference.htm
Advertisements