Spoofchecker::setAllowedChars
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
Spoofchecker::setAllowedChars
Референца за `spoofchecker.setallowedchars.php` со подобрена типографија и навигација.
Spoofchecker::setAllowedChars
Класата Dom\DtdNamedNodeMap
Spoofchecker::setAllowedChars — Set the set of characters allowed when running checks
= NULL
Restricts the characters that are considered acceptable by subsequent checks to the set described by pattern. Any character outside of this set causes (PHP 5 >= 5.4.0, PHP 7, PHP 8, PECL intl >= 2.0.0) to report a result.
Параметри
pattern-
A character set described as a
UnicodeSetpattern, that is a regular-expression style character class. It must begin with[and end with], for example[a-z0-9]. patternOptions-
A bitmask controlling how
patternis interpreted. It must be0, илиSpoofchecker::IGNORE_SPACEon its own or combined with exactly one ofSpoofchecker::CASE_INSENSITIVE,Spoofchecker::ADD_CASE_MAPPINGS, илиSpoofchecker::SIMPLE_CASE_INSENSITIVE.
Вратени вредности
Не се враќа вредност.
Errors/Exceptions
Фрла ValueError if pattern is not a valid character set pattern, or if patternOptions is not a valid combination of options.
Примери
Пример #1 Spoofchecker::setAllowedChars() example
<?php
$checker = new Spoofchecker();
$checker->setAllowedChars('[a-z0-9]');
var_dump($checker->isSuspicious('hello'));
var_dump($checker->isSuspicious('héllo'));
?>Пример #1 Пример што покажува затворачка ознака што го опфаќа последниот нов ред
bool(false) bool(true)
Види Исто така
- Spoofchecker::setAllowedLocales() - Проверува дали даден текст содржи сомнителни знаци
- (PHP 5 >= 5.4.0, PHP 7, PHP 8, PECL intl >= 2.0.0) - Проверува дали дадените низи можат да бидат збунети