Update README.md
must use lowercase for valid TLD comparison
This commit is contained in:
parent
bfb9fd5dda
commit
1f0e039b6e
|
@ -36,7 +36,7 @@ The lists can be conveniently used in PHP or Node projects including this packag
|
|||
|
||||
tldCheck = "com";
|
||||
console.log("Is '" + tldCheck + "' a real TLD?");
|
||||
if (tldEnum.tldList.indexOf(tldCheck) != -1) {
|
||||
if (tldEnum.tldList.indexOf(tldCheck.toLowerCase()) != -1) {
|
||||
console.log(" yes");
|
||||
} else {
|
||||
console.log(" no");
|
||||
|
@ -44,7 +44,7 @@ The lists can be conveniently used in PHP or Node projects including this packag
|
|||
|
||||
tldCheck = "somethingWeird";
|
||||
console.log("Is '" + tldCheck + "' a real TLD?");
|
||||
if (tldEnum.tldList.indexOf(tldCheck) != -1) {
|
||||
if (tldEnum.tldList.indexOf(tldCheck.toLowerCase()) != -1) {
|
||||
console.log(" yes");
|
||||
} else {
|
||||
console.log(" no");
|
||||
|
@ -85,7 +85,7 @@ The lists can be conveniently used in PHP or Node projects including this packag
|
|||
|
||||
$tldCheck = "com";
|
||||
echo "Is '$tldCheck' a real TLD?\n";
|
||||
if (in_array($tldCheck, TldEnum::TLD_ENUM)) {
|
||||
if (in_array(strtolower($tldCheck), TldEnum::TLD_ENUM)) {
|
||||
echo " yes\n";
|
||||
} else {
|
||||
echo " no\n";
|
||||
|
@ -93,7 +93,7 @@ The lists can be conveniently used in PHP or Node projects including this packag
|
|||
|
||||
$tldCheck = "somethingWeird";
|
||||
echo "Is '$tldCheck' a real TLD?\n";
|
||||
if (in_array($tldCheck, TldEnum::TLD_ENUM)) {
|
||||
if (in_array(strtolower($tldCheck), TldEnum::TLD_ENUM)) {
|
||||
echo " yes\n";
|
||||
} else {
|
||||
echo " no\n";
|
||||
|
|
Loading…
Reference in New Issue