PHP code example of tomverran / robots-txt-checker

1. Go to this page and download the library: Download tomverran/robots-txt-checker 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/ */

    

tomverran / robots-txt-checker example snippets



use \tomverran\Robot\RobotsTxt;
$robotsTxt = new RobotsTxt(file_get_contents('http://your-site-here/robots.txt'));
$canViewPage = $robotsTxt->isAllowed('my-user-agent', '/some/path/');