diff options
Diffstat (limited to 'ext/standard/tests/file/fgetcsv_variation30.phpt')
-rw-r--r-- | ext/standard/tests/file/fgetcsv_variation30.phpt | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/ext/standard/tests/file/fgetcsv_variation30.phpt b/ext/standard/tests/file/fgetcsv_variation30.phpt index e474b2d546..2cb570c8dc 100644 --- a/ext/standard/tests/file/fgetcsv_variation30.phpt +++ b/ext/standard/tests/file/fgetcsv_variation30.phpt @@ -2,7 +2,7 @@ Test fgetcsv() : usage variations - with file handle and length, file pointer pointing at end of file --FILE-- <?php -/* +/* Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] ); Description: Gets line from file pointer and parse for CSV fields */ @@ -14,8 +14,8 @@ Test fgetcsv() : usage variations - with file handle and length, file pointer po echo "*** Testing fgetcsv() : with file handle and length arguments, file pointer pointing at end of file ***\n"; -/* the array is with two elements in it. Each element should be read as - 1st element is delimiter & 2nd element is csv fields +/* the array is with two elements in it. Each element should be read as + 1st element is delimiter & 2nd element is csv fields */ $csv_lists = array ( array(',', 'water,fruit'), @@ -31,7 +31,7 @@ $filename = dirname(__FILE__) . '/fgetcsv_variation30.tmp'; $file_modes = array ("r","rb", "rt", "r+", "r+b", "r+t", "a+", "a+b", "a+t", "w+", "w+b", "w+t", - "x+", "x+b", "x+t"); + "x+", "x+b", "x+t"); $loop_counter = 1; foreach ($csv_lists as $csv_list) { @@ -60,18 +60,18 @@ foreach ($csv_lists as $csv_list) { if ( strstr($file_modes[$mode_counter], "r" ) ) { fclose($file_handle); $file_handle = fopen($filename, $file_modes[$mode_counter]); - } - - echo "\n-- Testing fgetcsv() with file opened using $file_modes[$mode_counter] mode --\n"; + } + + echo "\n-- Testing fgetcsv() with file opened using $file_modes[$mode_counter] mode --\n"; // set the file pointer to EOF var_dump( fseek($file_handle, 0, SEEK_END) ); - + // call fgetcsv() to parse csv fields - // now file pointer should point to end of the file, try reading again + // now file pointer should point to end of the file, try reading again var_dump( feof($file_handle) ); - var_dump( fgetcsv($file_handle, 1024) ); + var_dump( fgetcsv($file_handle, 1024) ); // check the file pointer position and if eof var_dump( ftell($file_handle) ); var_dump( feof($file_handle) ); @@ -79,7 +79,7 @@ foreach ($csv_lists as $csv_list) { fclose($file_handle); //delete file unlink($filename); - } //end of mode loop + } //end of mode loop } // end of foreach echo "Done\n"; |