We need to read (not execute) a script from a PHP script running on our server. Essentially we need to parse some data from the script. Most users of the script can use it directly, but because we're doing this using other people's tools we have to go in, get the data, and do the work ourselves.
We're using curl_exec, which works fine for reading data from HTML pages, but some very odd things happen when we try to do it on a page that starts with document.write. Any suggestions would be greatly appreciated.