Tag Archives: check if string contains specific word

How to check if string contains specific word PHP

How to check if string contains specific word PHP

With PHP 8 there comes a default function by which we can check if string contains specific word or not. For the lesser versions than php 8,below functions can be used. The other function which can be used is stripos() which perform case insensitive search. Please check the use of !== false is deliberate (neither != false nor === true will …