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";
|
tldCheck = "com";
|
||||||
console.log("Is '" + tldCheck + "' a real TLD?");
|
console.log("Is '" + tldCheck + "' a real TLD?");
|
||||||
if (tldEnum.tldList.indexOf(tldCheck) != -1) {
|
if (tldEnum.tldList.indexOf(tldCheck.toLowerCase()) != -1) {
|
||||||
console.log(" yes");
|
console.log(" yes");
|
||||||
} else {
|
} else {
|
||||||
console.log(" no");
|
console.log(" no");
|
||||||
|
@ -44,7 +44,7 @@ The lists can be conveniently used in PHP or Node projects including this packag
|
||||||
|
|
||||||
tldCheck = "somethingWeird";
|
tldCheck = "somethingWeird";
|
||||||
console.log("Is '" + tldCheck + "' a real TLD?");
|
console.log("Is '" + tldCheck + "' a real TLD?");
|
||||||
if (tldEnum.tldList.indexOf(tldCheck) != -1) {
|
if (tldEnum.tldList.indexOf(tldCheck.toLowerCase()) != -1) {
|
||||||
console.log(" yes");
|
console.log(" yes");
|
||||||
} else {
|
} else {
|
||||||
console.log(" no");
|
console.log(" no");
|
||||||
|
@ -85,7 +85,7 @@ The lists can be conveniently used in PHP or Node projects including this packag
|
||||||
|
|
||||||
$tldCheck = "com";
|
$tldCheck = "com";
|
||||||
echo "Is '$tldCheck' a real TLD?\n";
|
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";
|
echo " yes\n";
|
||||||
} else {
|
} else {
|
||||||
echo " no\n";
|
echo " no\n";
|
||||||
|
@ -93,7 +93,7 @@ The lists can be conveniently used in PHP or Node projects including this packag
|
||||||
|
|
||||||
$tldCheck = "somethingWeird";
|
$tldCheck = "somethingWeird";
|
||||||
echo "Is '$tldCheck' a real TLD?\n";
|
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";
|
echo " yes\n";
|
||||||
} else {
|
} else {
|
||||||
echo " no\n";
|
echo " no\n";
|
||||||
|
|
Loading…
Reference in New Issue