PHP code example of jstewmc / browser

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

    

jstewmc / browser example snippets


namespace Jstewmc\Browser;

// create a new browser
$browser = (new Browser())
    ->setPlatform('Macintosh')
    ->setName('Safari')
    ->setVersion('10.0.1');
    
// get the browser's information
$browser->getPlatform();  // returns "Macintosh"
$browser->getName();      // returns "Safari"
$browser->getVersion();   // returns "10.0.1"