Answers for "how to check string contains. in php"

PHP
6

php find if string contains

if (strpos($string, 'substring') !== false) {
	// do stuff 
}
Posted by: Guest on August-25-2020
3

if text contains word then in php

if (strpos($haystack,$needle) !== false) {
    echo "$haystack contains $needle";
}
Posted by: Guest on July-16-2020

Code answers related to "how to check string contains. in php"

Browse Popular Code Answers by Language