1. Go to this page and download the library: Download buibr/multicast-ip 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/ */
buibr / multicast-ip example snippets
use Buibr\Multicast\Multicast;
$ipAddress = '239.255.0.1';
if (Multicast::isValidMulticastIP($ipAddress)) {
echo "Valid Multicast IP";
}
use Buibr\Multicast\Multicast;
$ip = Multicast::create('udp://239.0.0.10:12345');
$ip->add();
//or
$ip->getIp()->increment();
print (string)$mc // 'udp://239.0.0.11:12345',
$ip->sub();
or
$ip->getIp()->decrement();
print (string)$mc // 'udp://239.0.0.9:12345',