diff options
Diffstat (limited to 'ext/spl/tests/SplFileObject_fputcsv_variation8.phpt')
-rw-r--r-- | ext/spl/tests/SplFileObject_fputcsv_variation8.phpt | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/ext/spl/tests/SplFileObject_fputcsv_variation8.phpt b/ext/spl/tests/SplFileObject_fputcsv_variation8.phpt index f1a8cbf7b1..64f32187ac 100644 --- a/ext/spl/tests/SplFileObject_fputcsv_variation8.phpt +++ b/ext/spl/tests/SplFileObject_fputcsv_variation8.phpt @@ -1,5 +1,5 @@ --TEST-- -Test fputcsv() : usage variations - with same delimiter and different enclosure +Test fputcsv() : usage variations - with same delimiter and different enclosure --FILE-- <?php @@ -10,8 +10,8 @@ Test fputcsv() : usage variations - with same delimiter and different enclosure echo "*** Testing fputcsv() : with same delimiter and different enclosure ***\n"; -/* the array is with three elements in it. Each element should be read as - 1st element is delimiter, 2nd element is enclosure +/* the array is with three elements in it. Each element should be read as + 1st element is delimiter, 2nd element is enclosure and 3rd element is csv fields */ $csv_lists = array ( @@ -32,13 +32,13 @@ $file = "$file_path/fputcsv_variation8.tmp"; $file_modes = array ("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) { for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { - - echo "\n-- file opened in $file_modes[$mode_counter] --\n"; + + echo "\n-- file opened in $file_modes[$mode_counter] --\n"; // create the file and add the content with has csv fields if ( strstr($file_modes[$mode_counter], "r") ) { $fo = new SplFileObject($file, 'w'); @@ -48,7 +48,7 @@ foreach ($csv_lists as $csv_list) { $delimiter = $csv_list[0]; $enclosure = $csv_list[1]; $csv_field = $csv_list[2]; - + // write to a file in csv format var_dump( $fo->fputcsv($csv_field, $delimiter, '+') ); // check the file pointer position and eof @@ -56,13 +56,13 @@ foreach ($csv_lists as $csv_list) { var_dump( $fo->eof() ); //close the file unset($fo); - - // print the file contents + + // print the file contents var_dump( file_get_contents($file) ); //delete file unlink($file); - } //end of mode loop + } //end of mode loop } // end of foreach echo "Done\n"; |