Mega Code Archive

 
Categories / Php / Strings
 

Detecting whether a string is contained in another string

<?php $password="secretpassword1"; if (strstr($password,"password")){     echo('Passwords cannot contain the word "password".'); } else {     echo ("Password accepted."); } ?>