Php program to search for text within a string using strpos

A Php program to search for text within a string using strpos. Using this program we can search the string in group of text. The strpos() method determines the position of a string’s first occurrence within another string. The strpos() function returns the position of a string, while the stripos() function does the same thing but in a case-insensitive manner. Both return the first occurrence of a string within another string’s location.

<?php
echo strpos("welcome to inlarn", "inlarn");
?>

 

Output:

11