Tak.
Min kode ser sådan her ud pt.
<?php
/**
@Filmtrailer catcher by JESPER KAMPMANN MADSEN
@2008 FOR FATFROG - 22:17 09-02-2009
COPYRIGHT JESPER KAMPMANN MADSEN
J@JAYKAY.DK - MESSENGER & E-MAIL
**/
class Filmtrailer
{
public function BeginCathing($URL, $D)
{
$k = file_get_contents($URL);
preg_match_all("/<original_title>(.*?)<\/original_title>/", $k, $Title);
preg_match_all("/<movie_duration>(.*?)<\/movie_duration>/", $k, $Duration);
preg_match_all("/<production_year>(.*?)<\/production_year>/", $k, $Year);
preg_match_all("/<actors>(.*?)<\/actors>/", $k, $Actors);
preg_match_all("/<directors>(.*?)<\/directors>/", $k, $Directors);
preg_match_all("/<categories>(.*?)<\/categories>/", $k, $Categories);
preg_match_all("/<distributors>(.*?)<\/distributors>/", $k, $Distributor);
preg_match_all("/<description>(.*?)<\/description>/", $k, $Description);
preg_match_all("/<pub_date unix_stamp=\"(.*?)\">(.*?)<\/pub_date>/", $k, $UnixTime);
preg_match_all("|<file.*?<url>(.*?)<\/url><\/file>|", $k, $Trailer);
print_r($Trailer);
echo "<h1>" . $D . "</h1>";
for ( $i=0;$i<count($Title[1]);$i++)
{
/** @Split ACTORS **/
$Ac = split("<actors>", $Actors[0][$i]);
$ActorsNew = str_replace("</actor>", ",", $Ac);
$RealActors = strip_tags($ActorsNew[1]);
/** @Split DIRECTORS **/
$Ds = split("<directors>", $Directors[0][$i]);
$DirectorsNew = str_replace("</director>", ",", $Ds);
$RealDirectors = strip_tags($DirectorsNew[1]);
/** @Split CATEGORIES **/
$Cs = split("<categories>", $Categories[0][$i]);
$CategorieNew = str_replace("</categorie>", ",", $Cs);
$RealCategories = strip_tags($CategorieNew[1]);
/** @Split DISTRIBUTORS **/
$DSS = split("<distributors>", $Distributor[0][$i]);
$DistributorNew = str_replace("</distributor>", ",", $DSS);
$RealDistributors = strip_tags($DistributorNew[1]);
echo "Orginal Title: " . $Title[0][$i] . "<br />";
echo "Filmvarighed: " . $Duration[0][$i] . " min.<br />";
echo "Produktions år: " . $Year[0][$i] . "<br />";
echo "Instruktør: " . $RealDirectors . "<br />";
echo "Distriutør: " . $RealDistributors . "<br />";
echo "Trailer: " . $Trailer[0][$i] . "<br />";
echo "Genrer: " . $RealCategories . "<br />";
echo "Skuespiller: " . $RealActors . "<hr />" . $Description[0][$i] . "<hr />";
}
}
}
$n = new Filmtrailer;
echo "<pre>";
// Now in cinemas
$n->BeginCathing('http://dk.feed.playnw.com/v2.0/?ListType=Latest30InCinema&channel_user_id=100001','Now in Cinemas');
// Coming Soon on DVD
$n->BeginCathing('http://dk.feed.playnw.com/?ListType=Next30OnDVD&channel_user_id=100001','Coming Soon on DVD');
?>
Der er i alt 30 film i det XML dokument, hvordan kan jeg udtrække hver trailer-url i min for-løkke? Gider du komme med et simpelt kodeeksempel, så ville det være alletiders.
TAK!