PHP code example of willwashburn / canonical

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

    

willwashburn / canonical example snippets


 $canonical = new \Canonical\Canonical;
 
 // using some string of html fetched via curl or file get contents or carrier pigeon
 $html = file_get_contents('website.html');

 $canonical->url($html);
 //// http://www.yourlink.com