A simple (but real) hostname validator in PHP.
$ composer require africc/valid-hostname
<?php
require 'vendor/autoload.php';
if (AfriCC\Valid\hostname('google.com')) {
echo 'valid!';
}
Licensed under the MIT License. See the LICENSE file for details.