PHP code example of ptlis / conneg

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

    

ptlis / conneg example snippets


use ptlis\ConNeg\Negotiation;

$negotiation = new Negotiation();

$bestMime = $negotiation->mimeBest(
    $_SERVER['ACCEPT'], 
    'application/json;q=1,application/xml;q=0.75'
);