略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: 范例

2024-04-25

范例

This example shows how to open a CrackLib dictionary, test a given password, retrieve any diagnostic messages, and close the dictionary.

Example #1 CrackLib example

<?php
// Open CrackLib Dictionary
$dictionary crack_opendict('/usr/local/lib/pw_dict')
     or die(
'Unable to open CrackLib dictionary');

// Perform password check
$check crack_check($dictionary'gx9A2s0x');

// Retrieve messages
$diag crack_getlastmessage();
echo 
$diag// 'strong password'

// Close dictionary
crack_closedict($dictionary);
?>

Note:

If crack_check() returns TRUE, crack_getlastmessage() will return 'strong password'.

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/crack.examples.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3