PHP code example of imelgrat / opml-parser
1. Go to this page and download the library: Download imelgrat/opml-parser 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/ */
imelgrat / opml-parser example snippets
use imelgrat\OPML_Parser\OPML_Parser;
$parser = new OPML_Parser();
// Get OPML from URL
$parser->ParseLocation('http://www.bbc.co.uk/podcasts.opml', null);
// Walk through each item in the same way as we would if $parser were a string (thanks to the Iterator interface)
foreach ($parser as $key => $item)
{
echo "<p> Item: " . $key . '</p><ul>';
foreach ($item as $attribute => $value)
{
echo '<li>' . '<strong>' . $attribute . '</strong>:' . $value . '</li>';
}
echo '</ul>';
echo '<p> </p>';
}