PHP Detecting Whether String Is Contained In Another String – String Function

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

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.