|
Posted by Mladen Gogala on 03/14/06 06:09
On Mon, 13 Mar 2006 16:00:45 +0100, VooDoo wrote:
> Hi,
> I have a database that have all my dell desktop with the dell serial number.
> I would like to update my database with the ship date from this url:
> http://support.euro.dell.com/support/topics/topic.aspx/emea/shared/support/my_systems_info/fr/details?c=en&cs=frbsdt1&l=fr&s=bsd&ServiceTag=1DTDD0J
>
> How can i easily get only the date from all this html page??
> Thanks for your ideas.
> VooDoo
#!/usr/local/bin/php
<?php
$url = 'http://tinyurl.com/qfehg';
$match = array();
$FILE = fopen($url, 'r');
while ($line = fread($FILE, 1024)) {
if (preg_match('/ship date:.*(\d{2}\/\d{2}\/\d{4})/i', $line, $match)) {
echo "Ship date is:", $match[1], "\n";
fclose($FILE);
break;
}
}
?>
Ship date is extracted. How are you going to update database and
what database are you talking about is another matter indeed. This
was a really simple programming exercise.
--
http://www.mgogala.com
[Back to original message]
|