snlildude87 0 Report post Posted September 30, 2005 Hey guys. I was wondering if there is an alternative to using file(). I'm trying to read a file and store it into an array without using the file function. Before, I was doing something like this: <?php $file = file("http://yahoo.com");?> Simple. It gets the contents of index.html at yahoo.com and store each line in an array. Well, I was wondering if there is another code that could do that without using the file function.Thanks for helping! Share this post Link to post Share on other sites
SystemWisdom 0 Report post Posted October 1, 2005 You should check out:readfile()fopen()file_get_contents()Maybe those help? Share this post Link to post Share on other sites
snlildude87 0 Report post Posted October 1, 2005 I know that using file(), it returns an array, but what do those three functions return? How do I use them so that they can act like the file() function? Share this post Link to post Share on other sites
MarCrush 0 Report post Posted October 1, 2005 Why do you want to use a different function instead of file() . If it works just fine, why not use it. Share this post Link to post Share on other sites
snlildude87 0 Report post Posted October 1, 2005 Why do you want to use a different function instead of file() . If it works just fine, why not use it. 190779[/snapback] Because the server where I'm at right now doesn't allow that. Anyway, I found an alternative: $filestring = file_get_contents($filename); $filearray = explode("\n", $filestring); Thanks anyway. I'm closing this thread now since my question is solved. Share this post Link to post Share on other sites