Re: Capture content

From: Date: Sat, 20 Apr 2002 13:03:03 +0000
Subject: Re: Capture content
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-18692@lists.php.net to get a copy of this message
"Ciprian Trofin" <ciprian.trofin@mail.mfinante.gv.ro> wrote in message news:8076471370.20020420113725@mail.mfinante.gv.ro... > price of the stock on a daily basis. My friend checks the Bucharest Stock > Exchange page, or other relevant page, and updates the price of the stock, for > future reference. > I think there is a easier way, that is making a script to load the > remote web page containing the updated stock price. You need to look at the curl extension. // get the page... $ch = curl_init("http://url/path.html"); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); $pg = curl_exec ($ch); curl_close ($ch); // $pg now contains the source for the page Then you need to examine the contents of $pg and look for ways to grab the values you need out of the string with the ereg* or preg* functions.

« previous php.db (#18692) next »