www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] Loading a file into a variable

Threaded View

  1. #1
    Join Date
    Apr 2006
    Posts
    58

    resolved [RESOLVED] Loading a file into a variable

    I was just wondereing if there is a way to load an external text file into a variable.

    I've heard that u can use openfile() to directly echo a file's content onto the page. But that's no good of I want to play around with the file in php.

    I've also head that there's a way to read a file using fopen() eg.
    Code:
    //second parameter can content: a=append, r=read, w=write etc.
    $myFile = fopen("aFile.txt","r");
    //do something over here to load it into a variable
    For when I just echo "$myFile" it returns "Resource id #2".

    Can anyone help??
    Last edited by jclarke; 08-02-2006 at 03:42 AM.
    HTML+Flash+JavaScript+CSS = Some Kick-Ass Website

    JacobClarkeZone.com - Members Zone, Games, Toons, Graphics, Music and more...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles