php check if string contains substring

strpos:


if( strpos( $string, $substring ) === false ) { // substring not found in string

	// code

} else { // substring found in string

	// code

}

Leave a Comment