How to use strstr in PHP

In this article I will explain how strstr function can be used in PHP.
  • 1633

strstr() Function

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

Syntax

strstr(string,search)

 

 Parameter  Description
 string  Required. Specifies the string to search
 search  Required. Specifies the string to search for.

Example

<html>
<body>
<?php
echo strstr("Hello Arun!","Arun");
?>
</body>
</html>

 

Output


strstr-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.