File: examples/index.php

Recommend this page to a friend!
  Classes of Ivan Melgrati  >  OPML Parser Class  >  examples/index.php  >  Download  
File: examples/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: OPML Parser Class
Extract the properties of content from OPML files
Author: By
Last change: Updated Composer autoload to PSR-4 (using imelgrat\OPML_Parser as namespace).
Updated example to use imelgrat\OPML_Parser (when loading class manually).
Updated docs to match latest changes
Updated README file.
Date: 2 years ago
Size: 956 bytes


Class file image Download

use imelgrat\OPML_Parser\OPML_Parser;
    require_once (
<title>OPML Parser Example</title>
<form action="index.php" method="post" name="form1" target="_self" id="form1">
  <label>URL of OPML file
  <input name="url" type="text" id="url" value="<?php
echo ($_POST['url'] != '' ? $_POST['url'] : '');
?>" size="60" maxlength="255"/>
    <input type="submit" name="Submit" value="Submit" />
if ($_POST['url'] != '')
$parser = new OPML_Parser();

$parser->ParseLocation($_POST['url'], null);

        foreach (
$parser as $key => $item)
"<p> Item: " . $key . '</p><ul>';
            foreach (
$item as $attribute => $value)
'<li>' . '<strong>' . $attribute . '</strong>:' . $value . '</li>';


For more information send a message to info at phpclasses dot org.