PHP code example of elubilu / password-meter

1. Go to this page and download the library: Download elubilu/password-meter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

elubilu / password-meter example snippets




$app =  new passwordMeter\passwordMeter();
$app->password_strength("1111"); // return  message = "Very Weak" , strength = 14  , percentage = 11%
$app->password_strength("aaaa"); // return  message = "Very Weak" , strength = 19 , percentage = 15%
$app->password_strength("####"); // return  message = "Very Weak" , strength = 21 , percentage = 17%
$app->password_strength("banglad"); // return  message = "Weak" , strength = 33  , percentage = 26%
$app->password_strength("bangla1"); // return  message = "Good" , strength = 37  , percentage = 29%
$app->password_strength("bangladesh"); // return  message = "Good" , strength = 48  , percentage = 38%
$app->password_strength("bangla1desh"); // return  message = "Good" , strength = 57 , percentage = 45%
$app->password_strength("Bangla1desh"); // return  message = "Strong", strength = 66, percentage = 52%
$app->password_strength("Bangladesh#"); // return  message = "Strong", strength = 71, percentage = 56%
$app->password_strength("Bangla1desh#"); // return  message = "Strong", strength = 79, percentage = 62%
$app->password_strength("Hello71*Bangla1desh#"); // return  message = "Very Strong" , strength = 132  , percentage = 100%


$app =  new passwordMeter\passwordMeter();
$app->get_messages();
// Example: default messages of package, 
Array
(
    [VERY_WEAK] => Very Weak
    [WEAK] => Weak
    [GOOD] => Good
    [STRONG] => Strong
    [VERY_STRONG] => Very Strong
)



$app =  new passwordMeter\passwordMeter();
$app->get_configs();
// Example: default configs of package, 
Array
(
    [SMALL_LETTER] => Array
        (
            [min] => 0
            [max] => 26
        )

    [CAPITAL_LETTER] => Array
        (
            [min] => 0
            [max] => 26
        )

    [NUMERIC] => Array
        (
            [min] => 0
            [max] => 255
        )

    [SPECIAL_CHAR] => Array
        (
            [min] => 0
            [max] => 33
        )

)