Hm jednostavno sam se odusevio. Ne znam sto. Parsiranje xml-a. Vjerovatno elegancija upotrebe
Probajte npr. staviti file http://www.mycity.rs/rss.php?f=18
<?php
function parse_one_file($file){
$str = file_get_contents($file);
$p = xml_parser_create();
xml_parse_into_struct($p, $str, $val, $index);
xml_parser_free($p);
return array($val, $index);
}
if($_GET['submit'])
list($val, $index) = parse_one_file( $_GET['file']);
?>
<form method='get' action='<?php print $PHP_SELF;?>'>
<input type='text' name='file' value='<?php print $_GET['file'];?>'><br><br>
<input type='submit' value='submit' name='submit'>
</form>
<?php
if($_GET['submit'])
foreach( $index["TITLE"] as $int => $ref ){
print "<a href='{$val[$index['LINK'][$int]]['value']}'>" . $val[$ref]['value'] . '</a><br>';
}
#var_dump($index);
#var_dump($val);
?>
|