Answers for "if a value in string php"

PHP
6

php find if string contains

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

php chech if string contains

$a = 'How are you?';

if (strpos($a, 'are') !== false) {
    echo 'true';
}
Posted by: Guest on April-28-2020

Code answers related to "if a value in string php"

Browse Popular Code Answers by Language