Re: read file contents to a variable

From: Oli Filth (oli_filth_at_eatspam.hotmail.com)
Date: 11/30/04


Date: Mon, 29 Nov 2004 23:47:07 GMT

paul wrote:
> Is there a reason the file() function makes an array? The readfile()
> function is even more strange, it dumps the contents to the screen but
> if you try to set it to a variable, it gives only the number of bytes
> instead of the content. As best I can tell I'd need to use the file()
> function then extract that back by adding each character onto the
> another variable in a couple of loops which seems unnecessarilt complex
> like I must be missing something.

file_get_contents()

Oli



Relevant Pages

  • read file contents to a variable
    ... Is there a reason the filefunction makes an array? ... The readfile() ... function is even more strange, it dumps the contents to the screen but ...
    (alt.php)
  • Re: read file contents to a variable
    ... Oli Filth wrote: ... The readfile() ... >> function is even more strange, it dumps the contents to the screen but ...
    (alt.php)
  • Re: Klasse optimieren
    ... > private class TourFahrt ... > ReadFile() eine XML Datei ein. ... > in richtiger Reihenfolge in das Array Tourenplan. ... nun muß ich von Außen an die Daten in der ArrayList Tourenplan ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: save array to file, read it back in
    ... The ability to read the contents of binary files and dumps with "stuff" in them, although increasingly becoming a lost art, is still important in applications such as those employing serial comms. ... void SaveArray(CString Filename,unsigned char *pBuffer,long Size) ... //first write out the array size ...
    (microsoft.public.vc.mfc)
  • Re: Array template parameters
    ... the out of class initialization is required. ... I agree that if if 'array' has type ... which is the case because it is extern const. ... Strange. ...
    (comp.lang.cpp)