diff --git a/examples/js-demo.js b/examples/js-demo.js index 4ff7642..45224bb 100644 --- a/examples/js-demo.js +++ b/examples/js-demo.js @@ -7,7 +7,7 @@ let tldCheck; 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"); @@ -15,7 +15,7 @@ if (tldEnum.tldList.indexOf(tldCheck) != -1) { 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"); diff --git a/examples/php-demo.php b/examples/php-demo.php index 8f4f765..85cf6e0 100644 --- a/examples/php-demo.php +++ b/examples/php-demo.php @@ -8,7 +8,7 @@ echo "There are " . count(TldEnum::TLD_ENUM) . " IANA TLDs\n"; $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"; @@ -16,7 +16,7 @@ if (in_array($tldCheck, TldEnum::TLD_ENUM)) { $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";