PHP code example of jalle19 / php-tvheadend
1. Go to this page and download the library: Download jalle19/php-tvheadend 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/ */
jalle19 / php-tvheadend example snippets
use Jalle19\tvheadend;
// Create a new instance
$tvheadend = new tvheadend\Tvheadend('localhost', 9981);
// Create an IPTV network
$network = new tvheadend\model\network\IptvNetwork();
$network->networkname = 'Test network';
$network->max_streams = 5;
try {
$tvheadend->createNetwork($network);
}
catch (tvheadend\exception\RequestFailedException $e) {
die('Failed to create network');
}
// Loop through all networks and print their respective names
foreach ($tvheadend->getNetworks as $network)
echo $network->networkname.PHP_EOL;
// let's call this file command.php
mmand();
composer