<?php $korean = "한" . "국" . "말"; $x = new Spoofchecker(); echo "Is suspcious, en_US\n"; $x->setAllowedLocales('en_US'); var_dump($x->isSuspicious($korean)); echo "Is suspcious, ko_KR\n"; $x->setAllowedLocales('en_US, ko_KR'); var_dump($x->isSuspicious($korean));
<?php $url = "http://www.paypаl.com"; $x = new Spoofchecker(); echo "paypal with Cyrillic spoof characters\n"; var_dump($x->isSuspicious($url)); echo "certain all-uppercase Latin sequences can be spoof of Greek\n"; var_dump($x->isSuspicious("NAPKIN PEZ")); var_dump($x->isSuspicious("napkin pez"));
<?php $url = "http://www.paypаl.com"; $x = new Spoofchecker(); echo "Checking if words are confusable\n"; var_dump($x->areConfusable("hello, world", "goodbye, world")); var_dump($x->areConfusable("hello, world", "hello, world")); var_dump($x->areConfusable("hello, world", "he11o, wor1d"));
<?php $korean = "한" . "국" . "말"; $x = new Spoofchecker(); echo "Check with default settings\n"; var_dump($x->areConfusable("HELLO", "HЕLLO")); var_dump($x->areConfusable("hello", "hеllo")); echo "Change confusable settings\n"; $x->setChecks(Spoofchecker::MIXED_SCRIPT_CONFUSABLE | Spoofchecker::WHOLE_SCRIPT_CONFUSABLE | Spoofchecker::SINGLE_SCRIPT_CONFUSABLE); var_dump($x->areConfusable("HELLO", "HЕLLO")); var_dump($x->areConfusable("hello", "hеllo"));