略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Spoofchecker::areConfusable

2024-11-14

Spoofchecker::areConfusable

(PHP 5 >= 5.4.0, PHP 7, PHP 8, PECL intl >= 2.0.0)

Spoofchecker::areConfusableChecks if given strings can be confused

说明

public Spoofchecker::areConfusable(string $string1, string $string2, int &$errorCode = null): bool

Checks whether two given strings can easily be mistaken.

参数

string1

First string to check.

string2

Second string to check.

errorCode

This variable is set by-reference to int containing an error, if there was any.

返回值

Returns true if two given strings can be confused, false otherwise.

范例

示例 #1 Spoofchecker::areConfusable() example

<?php
$checker 
= new Spoofchecker();

$checker->areConfusable('google.com''goog1e.com'); // true
// Lower l can be confused with digit one

$checker->areConfusable('google.com''g00g1e.com'); // false
// Zero (0) cannot be easily confused with "o" letter
add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/spoofchecker.areconfusable.php

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