php check if string contains substring

strpos:

<?php
if( strpos( $string, $substring ) === false ) { // substring not found in string
	// code
} else { // substring found in string
	// code
}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *