1. Go to this page and download the library: Download geeklab/localname library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Geeklab\Localname\Resolvers\Mdns;
use Geeklab\Localname\Resolvers\Netbios;
use Geeklab\Localname\Resolvers\Llmnr;
use Geeklab\Localname\Resolvers\ReverseDns;
$mdns = new Mdns(timeout: 3.0);
$name = $mdns->resolve('192.168.1.100'); // returns string or null