Annotation of embedaddon/php/ext/standard/tests/file/fgetcsv_variation12.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test fgetcsv() : usage variations - two chars as enclosure & delimiter (various read and append modes)
3: --FILE--
4: <?php
5: /*
6: Prototype: array fgetcsv ( resource $handle [, int $length [, string $delimiter [, string $enclosure]]] );
7: Description: Gets line from file pointer and parse for CSV fields
8: */
9:
10: /* Testing fgetcsv() by providing two characters for enclosure and delimiter parameters */
11:
12: echo "*** Testing fgetcsv() : with two chars as enclosure & delimiter ***\n";
13:
14: /* the array is with three elements in it. Each element should be read as
15: 1st element is delimiter, 2nd element is enclosure
16: and 3rd element is csv fields
17: */
18: $csv_lists = array (
19: array(',', '"', '"water",fruit'),
20: array(',', '"', '"water","fruit"'),
21: array(' ', '^', '^water^ ^fruit^'),
22: array(':', '&', '&water&:&fruit&'),
23: array('=', '=', '=water===fruit='),
24: array('-', '-', '-water--fruit-air'),
25: array('-', '-', '-water---fruit---air-'),
26: array(':', '&', '&""""&:&"&:,:":&,&:,,,,')
27: );
28:
29: $filename = dirname(__FILE__) . '/fgetcsv_variation12.tmp';
30: @unlink($filename);
31:
32: $file_modes = array ("r","rb", "rt", "r+", "r+b", "r+t",
33: "a+", "a+b", "a+t");
34:
35: $loop_counter = 1;
36: foreach ($csv_lists as $csv_list) {
37: for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
38: // create the file and add the content with has csv fields
39: if ( strstr($file_modes[$mode_counter], "r") ) {
40: $file_handle = fopen($filename, "w");
41: } else {
42: $file_handle = fopen($filename, $file_modes[$mode_counter] );
43: }
44: if ( !$file_handle ) {
45: echo "Error: failed to create file $filename!\n";
46: exit();
47: }
48: $delimiter = $csv_list[0];
49: $enclosure = $csv_list[1];
50: $csv_field = $csv_list[2];
51: fwrite($file_handle, $csv_field . "\n");
52:
53: // write another line of text and a blank line
54: // this will be used to test, if the fgetcsv() read more than a line and its
55: // working when only a blank line is read
56: fwrite($file_handle, "This is line of text without csv fields\n");
57: fwrite($file_handle, "\n"); // blank line
58:
59: // close the file if the mode to be used is read mode and re-open using read mode
60: // else rewind the file pointer to begining of the file
61: if ( strstr($file_modes[$mode_counter], "r" ) ) {
62: fclose($file_handle);
63: $file_handle = fopen($filename, $file_modes[$mode_counter]);
64: } else {
65: // rewind the file pointer to bof
66: rewind($file_handle);
67: }
68:
69: echo "\n-- Testing fgetcsv() with file opened using $file_modes[$mode_counter] mode --\n";
70:
71: // call fgetcsv() to parse csv fields
72:
73: // use delimiter & enclosure char of two chars
74: fseek($file_handle, 0, SEEK_SET);
75: $del = "++";
76: $enc = "%%";
77: var_dump( fgetcsv($file_handle, 1024, $del, $enc) );
78: // check the file pointer position and if eof
79: var_dump( ftell($file_handle) );
80: var_dump( feof($file_handle) );
81:
82: // close the file
83: fclose($file_handle);
84: //delete file
85: unlink($filename);
86: } //end of mode loop
87: } // end of foreach
88:
89: echo "Done\n";
90: ?>
91: --EXPECTF--
92: *** Testing fgetcsv() : with two chars as enclosure & delimiter ***
93:
94: -- Testing fgetcsv() with file opened using r mode --
95:
96: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
97:
98: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
99: array(1) {
100: [0]=>
101: string(13) ""water",fruit"
102: }
103: int(14)
104: bool(false)
105:
106: -- Testing fgetcsv() with file opened using rb mode --
107:
108: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
109:
110: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
111: array(1) {
112: [0]=>
113: string(13) ""water",fruit"
114: }
115: int(14)
116: bool(false)
117:
118: -- Testing fgetcsv() with file opened using rt mode --
119:
120: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
121:
122: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
123: array(1) {
124: [0]=>
125: string(13) ""water",fruit"
126: }
127: int(14)
128: bool(false)
129:
130: -- Testing fgetcsv() with file opened using r+ mode --
131:
132: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
133:
134: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
135: array(1) {
136: [0]=>
137: string(13) ""water",fruit"
138: }
139: int(14)
140: bool(false)
141:
142: -- Testing fgetcsv() with file opened using r+b mode --
143:
144: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
145:
146: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
147: array(1) {
148: [0]=>
149: string(13) ""water",fruit"
150: }
151: int(14)
152: bool(false)
153:
154: -- Testing fgetcsv() with file opened using r+t mode --
155:
156: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
157:
158: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
159: array(1) {
160: [0]=>
161: string(13) ""water",fruit"
162: }
163: int(14)
164: bool(false)
165:
166: -- Testing fgetcsv() with file opened using a+ mode --
167:
168: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
169:
170: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
171: array(1) {
172: [0]=>
173: string(13) ""water",fruit"
174: }
175: int(14)
176: bool(false)
177:
178: -- Testing fgetcsv() with file opened using a+b mode --
179:
180: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
181:
182: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
183: array(1) {
184: [0]=>
185: string(13) ""water",fruit"
186: }
187: int(14)
188: bool(false)
189:
190: -- Testing fgetcsv() with file opened using a+t mode --
191:
192: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
193:
194: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
195: array(1) {
196: [0]=>
197: string(13) ""water",fruit"
198: }
199: int(14)
200: bool(false)
201:
202: -- Testing fgetcsv() with file opened using r mode --
203:
204: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
205:
206: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
207: array(1) {
208: [0]=>
209: string(15) ""water","fruit""
210: }
211: int(16)
212: bool(false)
213:
214: -- Testing fgetcsv() with file opened using rb mode --
215:
216: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
217:
218: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
219: array(1) {
220: [0]=>
221: string(15) ""water","fruit""
222: }
223: int(16)
224: bool(false)
225:
226: -- Testing fgetcsv() with file opened using rt mode --
227:
228: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
229:
230: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
231: array(1) {
232: [0]=>
233: string(15) ""water","fruit""
234: }
235: int(16)
236: bool(false)
237:
238: -- Testing fgetcsv() with file opened using r+ mode --
239:
240: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
241:
242: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
243: array(1) {
244: [0]=>
245: string(15) ""water","fruit""
246: }
247: int(16)
248: bool(false)
249:
250: -- Testing fgetcsv() with file opened using r+b mode --
251:
252: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
253:
254: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
255: array(1) {
256: [0]=>
257: string(15) ""water","fruit""
258: }
259: int(16)
260: bool(false)
261:
262: -- Testing fgetcsv() with file opened using r+t mode --
263:
264: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
265:
266: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
267: array(1) {
268: [0]=>
269: string(15) ""water","fruit""
270: }
271: int(16)
272: bool(false)
273:
274: -- Testing fgetcsv() with file opened using a+ mode --
275:
276: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
277:
278: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
279: array(1) {
280: [0]=>
281: string(15) ""water","fruit""
282: }
283: int(16)
284: bool(false)
285:
286: -- Testing fgetcsv() with file opened using a+b mode --
287:
288: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
289:
290: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
291: array(1) {
292: [0]=>
293: string(15) ""water","fruit""
294: }
295: int(16)
296: bool(false)
297:
298: -- Testing fgetcsv() with file opened using a+t mode --
299:
300: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
301:
302: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
303: array(1) {
304: [0]=>
305: string(15) ""water","fruit""
306: }
307: int(16)
308: bool(false)
309:
310: -- Testing fgetcsv() with file opened using r mode --
311:
312: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
313:
314: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
315: array(1) {
316: [0]=>
317: string(15) "^water^ ^fruit^"
318: }
319: int(16)
320: bool(false)
321:
322: -- Testing fgetcsv() with file opened using rb mode --
323:
324: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
325:
326: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
327: array(1) {
328: [0]=>
329: string(15) "^water^ ^fruit^"
330: }
331: int(16)
332: bool(false)
333:
334: -- Testing fgetcsv() with file opened using rt mode --
335:
336: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
337:
338: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
339: array(1) {
340: [0]=>
341: string(15) "^water^ ^fruit^"
342: }
343: int(16)
344: bool(false)
345:
346: -- Testing fgetcsv() with file opened using r+ mode --
347:
348: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
349:
350: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
351: array(1) {
352: [0]=>
353: string(15) "^water^ ^fruit^"
354: }
355: int(16)
356: bool(false)
357:
358: -- Testing fgetcsv() with file opened using r+b mode --
359:
360: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
361:
362: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
363: array(1) {
364: [0]=>
365: string(15) "^water^ ^fruit^"
366: }
367: int(16)
368: bool(false)
369:
370: -- Testing fgetcsv() with file opened using r+t mode --
371:
372: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
373:
374: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
375: array(1) {
376: [0]=>
377: string(15) "^water^ ^fruit^"
378: }
379: int(16)
380: bool(false)
381:
382: -- Testing fgetcsv() with file opened using a+ mode --
383:
384: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
385:
386: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
387: array(1) {
388: [0]=>
389: string(15) "^water^ ^fruit^"
390: }
391: int(16)
392: bool(false)
393:
394: -- Testing fgetcsv() with file opened using a+b mode --
395:
396: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
397:
398: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
399: array(1) {
400: [0]=>
401: string(15) "^water^ ^fruit^"
402: }
403: int(16)
404: bool(false)
405:
406: -- Testing fgetcsv() with file opened using a+t mode --
407:
408: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
409:
410: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
411: array(1) {
412: [0]=>
413: string(15) "^water^ ^fruit^"
414: }
415: int(16)
416: bool(false)
417:
418: -- Testing fgetcsv() with file opened using r mode --
419:
420: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
421:
422: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
423: array(1) {
424: [0]=>
425: string(15) "&water&:&fruit&"
426: }
427: int(16)
428: bool(false)
429:
430: -- Testing fgetcsv() with file opened using rb mode --
431:
432: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
433:
434: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
435: array(1) {
436: [0]=>
437: string(15) "&water&:&fruit&"
438: }
439: int(16)
440: bool(false)
441:
442: -- Testing fgetcsv() with file opened using rt mode --
443:
444: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
445:
446: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
447: array(1) {
448: [0]=>
449: string(15) "&water&:&fruit&"
450: }
451: int(16)
452: bool(false)
453:
454: -- Testing fgetcsv() with file opened using r+ mode --
455:
456: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
457:
458: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
459: array(1) {
460: [0]=>
461: string(15) "&water&:&fruit&"
462: }
463: int(16)
464: bool(false)
465:
466: -- Testing fgetcsv() with file opened using r+b mode --
467:
468: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
469:
470: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
471: array(1) {
472: [0]=>
473: string(15) "&water&:&fruit&"
474: }
475: int(16)
476: bool(false)
477:
478: -- Testing fgetcsv() with file opened using r+t mode --
479:
480: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
481:
482: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
483: array(1) {
484: [0]=>
485: string(15) "&water&:&fruit&"
486: }
487: int(16)
488: bool(false)
489:
490: -- Testing fgetcsv() with file opened using a+ mode --
491:
492: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
493:
494: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
495: array(1) {
496: [0]=>
497: string(15) "&water&:&fruit&"
498: }
499: int(16)
500: bool(false)
501:
502: -- Testing fgetcsv() with file opened using a+b mode --
503:
504: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
505:
506: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
507: array(1) {
508: [0]=>
509: string(15) "&water&:&fruit&"
510: }
511: int(16)
512: bool(false)
513:
514: -- Testing fgetcsv() with file opened using a+t mode --
515:
516: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
517:
518: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
519: array(1) {
520: [0]=>
521: string(15) "&water&:&fruit&"
522: }
523: int(16)
524: bool(false)
525:
526: -- Testing fgetcsv() with file opened using r mode --
527:
528: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
529:
530: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
531: array(1) {
532: [0]=>
533: string(15) "=water===fruit="
534: }
535: int(16)
536: bool(false)
537:
538: -- Testing fgetcsv() with file opened using rb mode --
539:
540: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
541:
542: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
543: array(1) {
544: [0]=>
545: string(15) "=water===fruit="
546: }
547: int(16)
548: bool(false)
549:
550: -- Testing fgetcsv() with file opened using rt mode --
551:
552: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
553:
554: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
555: array(1) {
556: [0]=>
557: string(15) "=water===fruit="
558: }
559: int(16)
560: bool(false)
561:
562: -- Testing fgetcsv() with file opened using r+ mode --
563:
564: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
565:
566: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
567: array(1) {
568: [0]=>
569: string(15) "=water===fruit="
570: }
571: int(16)
572: bool(false)
573:
574: -- Testing fgetcsv() with file opened using r+b mode --
575:
576: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
577:
578: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
579: array(1) {
580: [0]=>
581: string(15) "=water===fruit="
582: }
583: int(16)
584: bool(false)
585:
586: -- Testing fgetcsv() with file opened using r+t mode --
587:
588: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
589:
590: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
591: array(1) {
592: [0]=>
593: string(15) "=water===fruit="
594: }
595: int(16)
596: bool(false)
597:
598: -- Testing fgetcsv() with file opened using a+ mode --
599:
600: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
601:
602: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
603: array(1) {
604: [0]=>
605: string(15) "=water===fruit="
606: }
607: int(16)
608: bool(false)
609:
610: -- Testing fgetcsv() with file opened using a+b mode --
611:
612: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
613:
614: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
615: array(1) {
616: [0]=>
617: string(15) "=water===fruit="
618: }
619: int(16)
620: bool(false)
621:
622: -- Testing fgetcsv() with file opened using a+t mode --
623:
624: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
625:
626: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
627: array(1) {
628: [0]=>
629: string(15) "=water===fruit="
630: }
631: int(16)
632: bool(false)
633:
634: -- Testing fgetcsv() with file opened using r mode --
635:
636: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
637:
638: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
639: array(1) {
640: [0]=>
641: string(17) "-water--fruit-air"
642: }
643: int(18)
644: bool(false)
645:
646: -- Testing fgetcsv() with file opened using rb mode --
647:
648: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
649:
650: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
651: array(1) {
652: [0]=>
653: string(17) "-water--fruit-air"
654: }
655: int(18)
656: bool(false)
657:
658: -- Testing fgetcsv() with file opened using rt mode --
659:
660: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
661:
662: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
663: array(1) {
664: [0]=>
665: string(17) "-water--fruit-air"
666: }
667: int(18)
668: bool(false)
669:
670: -- Testing fgetcsv() with file opened using r+ mode --
671:
672: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
673:
674: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
675: array(1) {
676: [0]=>
677: string(17) "-water--fruit-air"
678: }
679: int(18)
680: bool(false)
681:
682: -- Testing fgetcsv() with file opened using r+b mode --
683:
684: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
685:
686: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
687: array(1) {
688: [0]=>
689: string(17) "-water--fruit-air"
690: }
691: int(18)
692: bool(false)
693:
694: -- Testing fgetcsv() with file opened using r+t mode --
695:
696: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
697:
698: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
699: array(1) {
700: [0]=>
701: string(17) "-water--fruit-air"
702: }
703: int(18)
704: bool(false)
705:
706: -- Testing fgetcsv() with file opened using a+ mode --
707:
708: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
709:
710: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
711: array(1) {
712: [0]=>
713: string(17) "-water--fruit-air"
714: }
715: int(18)
716: bool(false)
717:
718: -- Testing fgetcsv() with file opened using a+b mode --
719:
720: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
721:
722: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
723: array(1) {
724: [0]=>
725: string(17) "-water--fruit-air"
726: }
727: int(18)
728: bool(false)
729:
730: -- Testing fgetcsv() with file opened using a+t mode --
731:
732: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
733:
734: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
735: array(1) {
736: [0]=>
737: string(17) "-water--fruit-air"
738: }
739: int(18)
740: bool(false)
741:
742: -- Testing fgetcsv() with file opened using r mode --
743:
744: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
745:
746: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
747: array(1) {
748: [0]=>
749: string(21) "-water---fruit---air-"
750: }
751: int(22)
752: bool(false)
753:
754: -- Testing fgetcsv() with file opened using rb mode --
755:
756: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
757:
758: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
759: array(1) {
760: [0]=>
761: string(21) "-water---fruit---air-"
762: }
763: int(22)
764: bool(false)
765:
766: -- Testing fgetcsv() with file opened using rt mode --
767:
768: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
769:
770: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
771: array(1) {
772: [0]=>
773: string(21) "-water---fruit---air-"
774: }
775: int(22)
776: bool(false)
777:
778: -- Testing fgetcsv() with file opened using r+ mode --
779:
780: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
781:
782: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
783: array(1) {
784: [0]=>
785: string(21) "-water---fruit---air-"
786: }
787: int(22)
788: bool(false)
789:
790: -- Testing fgetcsv() with file opened using r+b mode --
791:
792: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
793:
794: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
795: array(1) {
796: [0]=>
797: string(21) "-water---fruit---air-"
798: }
799: int(22)
800: bool(false)
801:
802: -- Testing fgetcsv() with file opened using r+t mode --
803:
804: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
805:
806: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
807: array(1) {
808: [0]=>
809: string(21) "-water---fruit---air-"
810: }
811: int(22)
812: bool(false)
813:
814: -- Testing fgetcsv() with file opened using a+ mode --
815:
816: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
817:
818: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
819: array(1) {
820: [0]=>
821: string(21) "-water---fruit---air-"
822: }
823: int(22)
824: bool(false)
825:
826: -- Testing fgetcsv() with file opened using a+b mode --
827:
828: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
829:
830: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
831: array(1) {
832: [0]=>
833: string(21) "-water---fruit---air-"
834: }
835: int(22)
836: bool(false)
837:
838: -- Testing fgetcsv() with file opened using a+t mode --
839:
840: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
841:
842: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
843: array(1) {
844: [0]=>
845: string(21) "-water---fruit---air-"
846: }
847: int(22)
848: bool(false)
849:
850: -- Testing fgetcsv() with file opened using r mode --
851:
852: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
853:
854: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
855: array(1) {
856: [0]=>
857: string(23) "&""""&:&"&:,:":&,&:,,,,"
858: }
859: int(24)
860: bool(false)
861:
862: -- Testing fgetcsv() with file opened using rb mode --
863:
864: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
865:
866: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
867: array(1) {
868: [0]=>
869: string(23) "&""""&:&"&:,:":&,&:,,,,"
870: }
871: int(24)
872: bool(false)
873:
874: -- Testing fgetcsv() with file opened using rt mode --
875:
876: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
877:
878: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
879: array(1) {
880: [0]=>
881: string(23) "&""""&:&"&:,:":&,&:,,,,"
882: }
883: int(24)
884: bool(false)
885:
886: -- Testing fgetcsv() with file opened using r+ mode --
887:
888: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
889:
890: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
891: array(1) {
892: [0]=>
893: string(23) "&""""&:&"&:,:":&,&:,,,,"
894: }
895: int(24)
896: bool(false)
897:
898: -- Testing fgetcsv() with file opened using r+b mode --
899:
900: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
901:
902: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
903: array(1) {
904: [0]=>
905: string(23) "&""""&:&"&:,:":&,&:,,,,"
906: }
907: int(24)
908: bool(false)
909:
910: -- Testing fgetcsv() with file opened using r+t mode --
911:
912: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
913:
914: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
915: array(1) {
916: [0]=>
917: string(23) "&""""&:&"&:,:":&,&:,,,,"
918: }
919: int(24)
920: bool(false)
921:
922: -- Testing fgetcsv() with file opened using a+ mode --
923:
924: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
925:
926: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
927: array(1) {
928: [0]=>
929: string(23) "&""""&:&"&:,:":&,&:,,,,"
930: }
931: int(24)
932: bool(false)
933:
934: -- Testing fgetcsv() with file opened using a+b mode --
935:
936: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
937:
938: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
939: array(1) {
940: [0]=>
941: string(23) "&""""&:&"&:,:":&,&:,,,,"
942: }
943: int(24)
944: bool(false)
945:
946: -- Testing fgetcsv() with file opened using a+t mode --
947:
948: Notice: fgetcsv(): delimiter must be a single character in %s on line %d
949:
950: Notice: fgetcsv(): enclosure must be a single character in %s on line %d
951: array(1) {
952: [0]=>
953: string(23) "&""""&:&"&:,:":&,&:,,,,"
954: }
955: int(24)
956: bool(false)
957: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>