Menu

Add Topic

Forum

waiting answer July 28, 2021

How to Check If a String Contains a Specific Word in PHP

Answers
June 10, 2021

The PHP built-in function strpos() is used to check whether a string contains a specific word or not

The string position starts at 0 and not 1. If the search word exists in the string, it returns the position of the first occurrence of a substring in a string. The function strpos() returns false If the specific word not found in the string.

Let's check the following example to understand how this function actually works.

OUTPUT

           Found

0 0

Please Login to Post the answer

Leave an Answer