Jump to content

tottijohn

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tottijohn's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks, guess i am on the right track. $dir = 'matchreports'; $dh = opendir($dir); while (($file = readdir($dh)) !== false){ $fullfile = $dir ."/". $file; $subtotal[] = file_get_contents($fullfile); } print_r($subtotal); //added this for my viewing purpose only $keyword = substr_count($subtotal,'earth'); echo "$keyword"; Still, it returns 0 despite having the word earth appearing multiple times in each file.
  2. Thanks, i did read up on chmod. Guess the problem is i am testing it on a windows platform using WAMP5. $dir = 'matchreports'; $dh = opendir($dir); while (($file = readdir($dh)) !== false){ $fullfile = $dir. "/" . $file; $subtotal[] = file_get_contents($fullfile); } echo "$subtotal"; I am actually getting "Array" as the result instead of the contents from all the files in the folder. Am i missing out something?
  3. Care to elaborate abit more on setting permission? ???
  4. That solved the error, but now another arises; "file_get_contents(matchreports/.) [function.file-get-contents]: failed to open stream: Permission denied" & "file_get_contents(matchreports/..) [function.file-get-contents]: failed to open stream: Permission denied" I am trying to get the contents from the files, count the keywords before echoing out
  5. $dir = 'matchreports'; $dh = opendir($dir); while (($file = readdir($dh)) !== false){ $fullfile = $dir . $file; $subtotal[] = file_get_contents($fullfile); I am getting this msg "Warning: file_get_contents(matchreports010407.php) [function.file-get-contents]: failed to open stream: No such file or directory" 010407.php is one of the files i need to retrieve the contents from, including others from the folder. Pardon me cause i am relatively new to PHP, thanks.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.