Question: Write a PHP program that checks the elements of a string array named $Passwords . Use regular expressions to test whether each element is a

Write a PHP program that checks the elements of a string array named $Passwords. Use regular expressions to test whether each element is a strong password.

For this exercise, a strong password must have at least one number, one lowercase letter, one uppercase letter, no spaces, and at least one character that is not a letter or a number. The string should also be between 8 and 16 characters long.

The $Passwords array should contain at least 10 elements, and at least 6 of the elements should fail. Ensure that one entry fails each of the five regular expression tests and that at least one fails because of the length. Display whether each password in the $Passwords array was strong enough, and display the test that a password failed if it is not strong enough. Save the script as PasswordStrength.php

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!