All,

I'm new to PHP, so I'm trying to figure out how to do things that I used to do in ASP.

One of those things is getting data from another web page, server-side.

In ASP, I'd do this:

Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
objXML.open "GET", strURL, False
objXML.send()

I could then use regexp to pull out data from objXML.responseText.

How can I do the same thing in PHP?

Many thanks in advance!

Cheers,
Matt Stuehler

    Sorry - better searching turned up the result (I think): cURL.

    If anyone has a better solution, though, I'd appreciate it!

    Cheers

      You can usually use fopen() to fetch files via HTTP. This is normally fine- read the documentation on fopen and the wrappers for more information.

      I think fopen() is the best way of reading resources via HTTP because it does not depend on curl- although the curl library has more flexibility.

      Mark

        Write a Reply...