Re: Re: Retrieving Content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/3/06, Adam Zey <azey@xxxxxx> wrote:
Rodrigo de Oliveira Costa wrote:
> I just discovered the problem I have to retrieve the output of the
> site and not the url since its dynamic. Ca I do it like retrieve the
> output of this url:
>
> www.tryout.com/1/2/
>
> And of course store it on a variable? How to do it? I founr the func
> below but couldnt understand how to make it work with a url.
>
> Thanks guys,
> Rodrigo
>
>
> ob_start();
> include('file.php');  //  Could be a site here? What should I do to
> retrieve it from an url?
> $output = ob_get_contents();
> ob_end_clean();
Umm..... As I said, just use file_get_contents():

$file = file_get_contents("http://www.tryout.com/1/2/";);

Assuming allow_url_fopen is on.

If not, you could try using curl - see http://www.php.net/curl

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux