PHP code example of colonizator1 / tv-detector

1. Go to this page and download the library: Download colonizator1/tv-detector 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/ */

    

colonizator1 / tv-detector example snippets



TvDetector\TvDetector;

$userAgent = $_SERVER['HTTP_USER_AGENT'] ?? '';

if (TvDetector::isAndroidTV($userAgent)) {
    // Handle Android TV specifics
}

if (TvDetector::isTV($userAgent)) {
    // Handle generic TV
}