summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/fputcsv_variation7.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/file/fputcsv_variation7.phpt')
-rw-r--r--ext/standard/tests/file/fputcsv_variation7.phpt24
1 files changed, 12 insertions, 12 deletions
diff --git a/ext/standard/tests/file/fputcsv_variation7.phpt b/ext/standard/tests/file/fputcsv_variation7.phpt
index 8329251d73..789825de52 100644
--- a/ext/standard/tests/file/fputcsv_variation7.phpt
+++ b/ext/standard/tests/file/fputcsv_variation7.phpt
@@ -1,10 +1,10 @@
--TEST--
-Test fputcsv() : usage variations - with different delimiter and same enclosure
+Test fputcsv() : usage variations - with different delimiter and same enclosure
--FILE--
<?php
-/*
+/*
Prototype: array fputcsv ( resource $handle , array $fields [, string $delimiter [, string $enclosure]]] );
- Description: Format line as CSV and write to the file pointer
+ Description: Format line as CSV and write to the file pointer
*/
/*
@@ -14,8 +14,8 @@ Test fputcsv() : usage variations - with different delimiter and same enclosure
echo "*** Testing fputcsv() : with different delimiter and same 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 (
@@ -36,13 +36,13 @@ $filename = "$file_path/fputcsv_variation7.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") ) {
$file_handle = fopen($filename, "w");
@@ -56,7 +56,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( fputcsv($file_handle, $csv_field, '+', $enclosure) );
// check the file pointer position and eof
@@ -64,13 +64,13 @@ foreach ($csv_lists as $csv_list) {
var_dump( feof($file_handle) );
//close the file
fclose($file_handle);
-
- // print the file contents
+
+ // print the file contents
var_dump( file_get_contents($filename) );
//delete file
unlink($filename);
- } //end of mode loop
+ } //end of mode loop
} // end of foreach
echo "Done\n";