[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] PHP and include?





george kocke wrote:
Doug Simpson wrote:

If I am thinking correctly, there is an include function on php that will do this, but I need the syntax. Also, if possible, I need it to pull the txt file from the users' public_html folder.

$text = file_get_contents($filename);

file_get_contents() returns a single variable, whereas file() returns an array with each element corresponding a line of the file:

$text = file($filename);
foreach ($text) {
  // do something with the line of text
}

Petre





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]