Cod-nes Posted January 4, 2009 Share Posted January 4, 2009 Is there another way to get the file contends other than file_get_contents? Link to comment Share on other sites More sharing options...
zppblood Posted January 4, 2009 Share Posted January 4, 2009 PHP has many functions that do the samething or are a little different.From php.netfile_get_contents() is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by your OS to enhance performance.You can use file(), but that returns an array with each line being an element of that array. Link to comment Share on other sites More sharing options...
jeffman Posted January 4, 2009 Share Posted January 4, 2009 For PHP 4x, use fread(). See example 1 here: http://www.php.net/manual/en/function.fread.php Link to comment Share on other sites More sharing options...
Synook Posted January 5, 2009 Share Posted January 5, 2009 If you are retrieving the file from a remote server that is blocking the direct HTTP request (the Digg API does this, for example), then you can use an extension like cURL... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.