// Load the PHP CodeSniffer library require_once 'PHP_CodeSniffer/autoload.php'; // Create a new instance of the PHP CodeSniffer object $phpcs = new PHP_CodeSniffer\Runner(); // Set the coding standard to use for validation $phpcs->setStandard('PSR2'); // Validate the PHP file $results = $phpcs->runPhpCs('path/to/my/file.php');In this example, the PHP CodeSniffer library is loaded and a new instance of the `PHP_CodeSniffer\Runner()` object is created. The coding standard is then set to "PSR2", which is a popular standard for PHP coding. Finally, the `runPhpCs()` method is called to validate a PHP file and the results are returned.