RE: [PHP] fopen on windows

From: Date: Fri, 11 Nov 2005 21:23:00 +0000
Subject: RE: [PHP] fopen on windows
Groups: php.general 
Request: Send a blank email to php-general+get-225651@lists.php.net to get a copy of this message
[snip] Blank lines. Just to see if the problem is fgets(), try this: // Left off the "b" because it ain't binary :) $theFile = file_get_contents( "docs/InstallationInstructionMaster.txt", "r" ) or die; $lines = explode( "\n", $theFile ); foreach( $lines as $line ) { $line = explode( "\t", $line ); print_r( $line ); } [/snip] That works, as does the following; $lines = file('docs/InstallationInstructionMaster.txt'); foreach ($lines as $line){ echo $line . "<br />\n"; } So, I am perplexed. fgets() seems to have a problem of some sort. Any clues? Not that what I want to do requires fgets(), just curious now as I will use one of the other two methods.

« previous php.general (#225651) next »