[Javascript] Content Retrieval

Tim Makins spindrift at oceanfree.net
Wed Aug 11 07:28:30 CDT 2004


Oh, that's nice and simple !! I can cope with the extraction OK.

One question - what do you mean by 'if your php installation is older' ?
(My host uses PHP4.3.4)

Tim in Ireland.

----- Original Message ----- 
From: "Roger Roelofs" <rer at datacompusa.com>
To: "[JavaScript List]" <javascript at LaTech.edu>
Sent: Wednesday, August 11, 2004 11:55 AM
Subject: Re: OT: cURL (was Re: [Javascript] Content Retrieval)


> Tim,
> If you use php, curl is not necessary.
> 
> <?php
> 
> $var = file_get_contents("http://www.mydomain.com/index.html"); // puts 
> whole file in a string var
> 
> // if your php installation is older you can
> 
> $aVar = file("http://www.mydomain.com/index.html");  //puts file into 
> an array of lines
> $var = implode("\n", $aVar);                         //concatenates 
> array into string var
> 
> // extracting the required text is left as an exercise for the reader...
> 
> ?>
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 



More information about the Javascript mailing list