Hi all,
Can anyone tell me a better way to rewrite the below script?
It works fine, but a little server intensive.
Cheers,
micmac
<?php
$html = implode ('', file ('http://www.dvdonline.com.au/details.cfm?itemid=169'));
preg_match_all("!<td width=\"68%\" valign=\"middle\" class=\"tableHeading\"> (.*?)</td>!is", $html, $matches);
if(trim($matches[1][0]) != "")
{
$movie_title = trim($matches[1][0]);
} else
{
$movie_title = "unknown<br>";
}
echo "<b>Title</b> = $movie_title.<br>";
if(trim($matches[1][0]) != "")
{
$release = trim($matches[1][0]);
} else
{
$release = "unknown<br>";
}
echo "<b>Release</b> = $release.<br>";
if(trim($matches[1][0]) != "")
{
$synopsis = trim($matches[1][0]);
} else
{
$synopsis = "unknown<br>";
}
echo "<b>Synopsis</b> = $synopsis.<br>";
if(trim($matches[1][0]) != "")
{
$actor = trim($matches[1][0]);
} else
{
$actor = "unknown<br>";
}
echo "<b>Actor</b> = $actor.<br>";
if(trim($matches[1][0]) != "")
{
$director = trim($matches[1][0]);
} else
{
$director = "unknown<br>";
}
echo "<b>Director</b> = $director.<br>";
if(trim($matches[1][0]) != "")
{
$producer = trim($matches[1][0]);
} else
{
$producer = "unknown";
}
echo "<b>Producer</b> = $producer.";
?>