--- Rich <[EMAIL PROTECTED]> wrote:
> I am trying to see if there is a way to have a PHP script go to
> another site, pull down a text file, and write that file to the
> server. Not really sure where to start with this so would appreciate
> it if anyone would be able to point me to a sample script or something
> along those lines.
>
> Thanks!
>
> Rich
There are also ways to grab a text file using Linux command-line utilities like
wget or lynx and place the contents on the local server. A PHP script can run
them with the exec() or similar functions.
Within a PHP program you can obtain a remote file (or generated HTML from a PHP
or other script) with the file() function:
$array = file("http://www.someurl.com");
The variable $array is an array where each element holds a line of the HTML
source code of the file. The join() function can be used to place the array
elements in a single large string variable.
James
_____
James D. Keeline
http://www.Keeline.com http://www.Keeline.com/articles
http://Stratemeyer.org http://www.Keeline.com/TSCollection
http://www.ITeachPHP.com -- Free Computer Classes: Linux, PHP, etc.
Fall Semester Begins Sep 7 -- New Classes Start Every Few Weeks.
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/HKFolB/TM
--------------------------------------------------------------------~->
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/