PHP code example of andres-montanez / useragentstring-bundle

1. Go to this page and download the library: Download andres-montanez/useragentstring-bundle 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/ */

    

andres-montanez / useragentstring-bundle example snippets

 php

    class HomeController extends Controller
    {
        public function indexAction() {
            $ua = $this->get('user_agent');
            if ($ua->getCurrent()->isMobile()) {
                ...
            } else {
                ...
            }
        }
    }