How to use stristr in PHP

In this article I will explain how stristr function can be used in PHP.
  • 1516

stristr() Function

This function searches for the first occurrence of a string inside another string.

Syntax

stristr(string,search)

 

 Parameter  Description
 string  Required. Specifies the string to search
 search  Required. Specifies the string to search for.If parameter is a number it will search for the character matching the ASCII value of the number.

Example

<html>
 <body>
 <?php
 echo stristr("Hello Shard!",111);
 ?>
 </body>
 </html> 

 

Output


stristr-php.jpg

You may also want to read these related articles Click here

Ask Your Question

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.