PHP code example of lukaswhite / podcast-feed-validator
1. Go to this page and download the library: Download lukaswhite/podcast-feed-validator 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/ */
lukaswhite / podcast-feed-validator example snippets
use Lukaswhite\PodcastFeedValidator\Validator;
$validator = new Validator();
$validator->load('/path/to/feed.rss');
// or
$validator->setContent(/** raw content */);
$result = $validator->run();
if ($result->fails()) {
// ...do something
}
if ($result->hasErrors()) {
foreach ($result->getErrors() as $error) {
}
}
if ($result->hasWarnings()) {
foreach ($result->getWarnings() as $error) {
}
}
if ($result->hasRecommendations()) {
foreach ($result->getRecommendations() as $error) {
}
}