PHP code example of flextype-components / agent

1. Go to this page and download the library: Download flextype-components/agent 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/ */

    

flextype-components / agent example snippets


use Flextype\Component\Agent\Agent;

if (Agent::isMobile()) {
    // Do something...
}  

if (Agent::isRobot()) {
    // Do something...
}  

if (Agent::is('iphone')) {
     // Do something...
}

if (Agent::is(array('iphone', 'ipod'))) {
    // Do something...
}