|
Posted by Jerry Stuckle on 03/14/06 06:17
Mladen Gogala wrote:
> 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.
>
>
And this will fail if the ship date spans a 1024 byte block.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|