![]() ![]() | ![]() |
1.1 misho 1: --TEST--
2: Test fgetcsv() : usage variations - with all parameters specified
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() to read a file when all its parameters are provided */
11:
12: echo "*** Testing fgetcsv() : with all parameters specified ***\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_variation1.tmp';
30: @unlink($filename);
31:
32: $file_modes = array ("r","rb", "rt", "r+", "r+b", "r+t",
33: "a+", "a+b", "a+t",
34: "w+", "w+b", "w+t",
35: "x+", "x+b", "x+t");
36:
37: $loop_counter = 1;
38: foreach ($csv_lists as $csv_list) {
39: for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) {
40: // create the file and add the content with has csv fields
41: if ( strstr($file_modes[$mode_counter], "r") ) {
42: $file_handle = fopen($filename, "w");
43: } else {
44: $file_handle = fopen($filename, $file_modes[$mode_counter] );
45: }
46: if ( !$file_handle ) {
47: echo "Error: failed to create file $filename!\n";
48: exit();
49: }
50: $delimiter = $csv_list[0];
51: $enclosure = $csv_list[1];
52: $csv_field = $csv_list[2];
53:
54: fwrite($file_handle, $csv_field . "\n");
55: // write another line of text and a blank line
56: // this will be used to test, if the fgetcsv() read more than a line and its
57: // working when only a blank line is read
58: fwrite($file_handle, "This is line of text without csv fields\n");
59: fwrite($file_handle, "\n"); // blank line
60:
61: // close the file if the mode to be used is read mode and re-open using read mode
1.1.1.2 ! misho 62: // else rewind the file pointer to beginning of the file
1.1 misho 63: if ( strstr($file_modes[$mode_counter], "r" ) ) {
64: fclose($file_handle);
65: $file_handle = fopen($filename, $file_modes[$mode_counter]);
66: } else {
67: // rewind the file pointer to bof
68: rewind($file_handle);
69: }
70:
71: echo "\n-- Testing fgetcsv() with file opened using $file_modes[$mode_counter] mode --\n";
72:
73: // call fgetcsv() to parse csv fields
74:
75: // use the right delimiter and enclosure with max length
76: var_dump( fgetcsv($file_handle, 1024, $delimiter, $enclosure) );
77: // check the file pointer position and if eof
78: var_dump( ftell($file_handle) );
79: var_dump( feof($file_handle) );
80:
81: // close the file
82: fclose($file_handle);
83: //delete file
84: unlink($filename);
85: } //end of mode loop
86: } // end of foreach
87:
88: echo "Done\n";
89: ?>
90: --EXPECT--
91: *** Testing fgetcsv() : with all parameters specified ***
92:
93: -- Testing fgetcsv() with file opened using r mode --
94: array(2) {
95: [0]=>
96: string(5) "water"
97: [1]=>
98: string(5) "fruit"
99: }
100: int(14)
101: bool(false)
102:
103: -- Testing fgetcsv() with file opened using rb mode --
104: array(2) {
105: [0]=>
106: string(5) "water"
107: [1]=>
108: string(5) "fruit"
109: }
110: int(14)
111: bool(false)
112:
113: -- Testing fgetcsv() with file opened using rt mode --
114: array(2) {
115: [0]=>
116: string(5) "water"
117: [1]=>
118: string(5) "fruit"
119: }
120: int(14)
121: bool(false)
122:
123: -- Testing fgetcsv() with file opened using r+ mode --
124: array(2) {
125: [0]=>
126: string(5) "water"
127: [1]=>
128: string(5) "fruit"
129: }
130: int(14)
131: bool(false)
132:
133: -- Testing fgetcsv() with file opened using r+b mode --
134: array(2) {
135: [0]=>
136: string(5) "water"
137: [1]=>
138: string(5) "fruit"
139: }
140: int(14)
141: bool(false)
142:
143: -- Testing fgetcsv() with file opened using r+t mode --
144: array(2) {
145: [0]=>
146: string(5) "water"
147: [1]=>
148: string(5) "fruit"
149: }
150: int(14)
151: bool(false)
152:
153: -- Testing fgetcsv() with file opened using a+ mode --
154: array(2) {
155: [0]=>
156: string(5) "water"
157: [1]=>
158: string(5) "fruit"
159: }
160: int(14)
161: bool(false)
162:
163: -- Testing fgetcsv() with file opened using a+b mode --
164: array(2) {
165: [0]=>
166: string(5) "water"
167: [1]=>
168: string(5) "fruit"
169: }
170: int(14)
171: bool(false)
172:
173: -- Testing fgetcsv() with file opened using a+t mode --
174: array(2) {
175: [0]=>
176: string(5) "water"
177: [1]=>
178: string(5) "fruit"
179: }
180: int(14)
181: bool(false)
182:
183: -- Testing fgetcsv() with file opened using w+ mode --
184: array(2) {
185: [0]=>
186: string(5) "water"
187: [1]=>
188: string(5) "fruit"
189: }
190: int(14)
191: bool(false)
192:
193: -- Testing fgetcsv() with file opened using w+b mode --
194: array(2) {
195: [0]=>
196: string(5) "water"
197: [1]=>
198: string(5) "fruit"
199: }
200: int(14)
201: bool(false)
202:
203: -- Testing fgetcsv() with file opened using w+t mode --
204: array(2) {
205: [0]=>
206: string(5) "water"
207: [1]=>
208: string(5) "fruit"
209: }
210: int(14)
211: bool(false)
212:
213: -- Testing fgetcsv() with file opened using x+ mode --
214: array(2) {
215: [0]=>
216: string(5) "water"
217: [1]=>
218: string(5) "fruit"
219: }
220: int(14)
221: bool(false)
222:
223: -- Testing fgetcsv() with file opened using x+b mode --
224: array(2) {
225: [0]=>
226: string(5) "water"
227: [1]=>
228: string(5) "fruit"
229: }
230: int(14)
231: bool(false)
232:
233: -- Testing fgetcsv() with file opened using x+t mode --
234: array(2) {
235: [0]=>
236: string(5) "water"
237: [1]=>
238: string(5) "fruit"
239: }
240: int(14)
241: bool(false)
242:
243: -- Testing fgetcsv() with file opened using r mode --
244: array(2) {
245: [0]=>
246: string(5) "water"
247: [1]=>
248: string(5) "fruit"
249: }
250: int(16)
251: bool(false)
252:
253: -- Testing fgetcsv() with file opened using rb mode --
254: array(2) {
255: [0]=>
256: string(5) "water"
257: [1]=>
258: string(5) "fruit"
259: }
260: int(16)
261: bool(false)
262:
263: -- Testing fgetcsv() with file opened using rt mode --
264: array(2) {
265: [0]=>
266: string(5) "water"
267: [1]=>
268: string(5) "fruit"
269: }
270: int(16)
271: bool(false)
272:
273: -- Testing fgetcsv() with file opened using r+ mode --
274: array(2) {
275: [0]=>
276: string(5) "water"
277: [1]=>
278: string(5) "fruit"
279: }
280: int(16)
281: bool(false)
282:
283: -- Testing fgetcsv() with file opened using r+b mode --
284: array(2) {
285: [0]=>
286: string(5) "water"
287: [1]=>
288: string(5) "fruit"
289: }
290: int(16)
291: bool(false)
292:
293: -- Testing fgetcsv() with file opened using r+t mode --
294: array(2) {
295: [0]=>
296: string(5) "water"
297: [1]=>
298: string(5) "fruit"
299: }
300: int(16)
301: bool(false)
302:
303: -- Testing fgetcsv() with file opened using a+ mode --
304: array(2) {
305: [0]=>
306: string(5) "water"
307: [1]=>
308: string(5) "fruit"
309: }
310: int(16)
311: bool(false)
312:
313: -- Testing fgetcsv() with file opened using a+b mode --
314: array(2) {
315: [0]=>
316: string(5) "water"
317: [1]=>
318: string(5) "fruit"
319: }
320: int(16)
321: bool(false)
322:
323: -- Testing fgetcsv() with file opened using a+t mode --
324: array(2) {
325: [0]=>
326: string(5) "water"
327: [1]=>
328: string(5) "fruit"
329: }
330: int(16)
331: bool(false)
332:
333: -- Testing fgetcsv() with file opened using w+ mode --
334: array(2) {
335: [0]=>
336: string(5) "water"
337: [1]=>
338: string(5) "fruit"
339: }
340: int(16)
341: bool(false)
342:
343: -- Testing fgetcsv() with file opened using w+b mode --
344: array(2) {
345: [0]=>
346: string(5) "water"
347: [1]=>
348: string(5) "fruit"
349: }
350: int(16)
351: bool(false)
352:
353: -- Testing fgetcsv() with file opened using w+t mode --
354: array(2) {
355: [0]=>
356: string(5) "water"
357: [1]=>
358: string(5) "fruit"
359: }
360: int(16)
361: bool(false)
362:
363: -- Testing fgetcsv() with file opened using x+ mode --
364: array(2) {
365: [0]=>
366: string(5) "water"
367: [1]=>
368: string(5) "fruit"
369: }
370: int(16)
371: bool(false)
372:
373: -- Testing fgetcsv() with file opened using x+b mode --
374: array(2) {
375: [0]=>
376: string(5) "water"
377: [1]=>
378: string(5) "fruit"
379: }
380: int(16)
381: bool(false)
382:
383: -- Testing fgetcsv() with file opened using x+t mode --
384: array(2) {
385: [0]=>
386: string(5) "water"
387: [1]=>
388: string(5) "fruit"
389: }
390: int(16)
391: bool(false)
392:
393: -- Testing fgetcsv() with file opened using r mode --
394: array(2) {
395: [0]=>
396: string(5) "water"
397: [1]=>
398: string(5) "fruit"
399: }
400: int(16)
401: bool(false)
402:
403: -- Testing fgetcsv() with file opened using rb mode --
404: array(2) {
405: [0]=>
406: string(5) "water"
407: [1]=>
408: string(5) "fruit"
409: }
410: int(16)
411: bool(false)
412:
413: -- Testing fgetcsv() with file opened using rt mode --
414: array(2) {
415: [0]=>
416: string(5) "water"
417: [1]=>
418: string(5) "fruit"
419: }
420: int(16)
421: bool(false)
422:
423: -- Testing fgetcsv() with file opened using r+ mode --
424: array(2) {
425: [0]=>
426: string(5) "water"
427: [1]=>
428: string(5) "fruit"
429: }
430: int(16)
431: bool(false)
432:
433: -- Testing fgetcsv() with file opened using r+b mode --
434: array(2) {
435: [0]=>
436: string(5) "water"
437: [1]=>
438: string(5) "fruit"
439: }
440: int(16)
441: bool(false)
442:
443: -- Testing fgetcsv() with file opened using r+t mode --
444: array(2) {
445: [0]=>
446: string(5) "water"
447: [1]=>
448: string(5) "fruit"
449: }
450: int(16)
451: bool(false)
452:
453: -- Testing fgetcsv() with file opened using a+ mode --
454: array(2) {
455: [0]=>
456: string(5) "water"
457: [1]=>
458: string(5) "fruit"
459: }
460: int(16)
461: bool(false)
462:
463: -- Testing fgetcsv() with file opened using a+b mode --
464: array(2) {
465: [0]=>
466: string(5) "water"
467: [1]=>
468: string(5) "fruit"
469: }
470: int(16)
471: bool(false)
472:
473: -- Testing fgetcsv() with file opened using a+t mode --
474: array(2) {
475: [0]=>
476: string(5) "water"
477: [1]=>
478: string(5) "fruit"
479: }
480: int(16)
481: bool(false)
482:
483: -- Testing fgetcsv() with file opened using w+ mode --
484: array(2) {
485: [0]=>
486: string(5) "water"
487: [1]=>
488: string(5) "fruit"
489: }
490: int(16)
491: bool(false)
492:
493: -- Testing fgetcsv() with file opened using w+b mode --
494: array(2) {
495: [0]=>
496: string(5) "water"
497: [1]=>
498: string(5) "fruit"
499: }
500: int(16)
501: bool(false)
502:
503: -- Testing fgetcsv() with file opened using w+t mode --
504: array(2) {
505: [0]=>
506: string(5) "water"
507: [1]=>
508: string(5) "fruit"
509: }
510: int(16)
511: bool(false)
512:
513: -- Testing fgetcsv() with file opened using x+ mode --
514: array(2) {
515: [0]=>
516: string(5) "water"
517: [1]=>
518: string(5) "fruit"
519: }
520: int(16)
521: bool(false)
522:
523: -- Testing fgetcsv() with file opened using x+b mode --
524: array(2) {
525: [0]=>
526: string(5) "water"
527: [1]=>
528: string(5) "fruit"
529: }
530: int(16)
531: bool(false)
532:
533: -- Testing fgetcsv() with file opened using x+t mode --
534: array(2) {
535: [0]=>
536: string(5) "water"
537: [1]=>
538: string(5) "fruit"
539: }
540: int(16)
541: bool(false)
542:
543: -- Testing fgetcsv() with file opened using r mode --
544: array(2) {
545: [0]=>
546: string(5) "water"
547: [1]=>
548: string(5) "fruit"
549: }
550: int(16)
551: bool(false)
552:
553: -- Testing fgetcsv() with file opened using rb mode --
554: array(2) {
555: [0]=>
556: string(5) "water"
557: [1]=>
558: string(5) "fruit"
559: }
560: int(16)
561: bool(false)
562:
563: -- Testing fgetcsv() with file opened using rt mode --
564: array(2) {
565: [0]=>
566: string(5) "water"
567: [1]=>
568: string(5) "fruit"
569: }
570: int(16)
571: bool(false)
572:
573: -- Testing fgetcsv() with file opened using r+ mode --
574: array(2) {
575: [0]=>
576: string(5) "water"
577: [1]=>
578: string(5) "fruit"
579: }
580: int(16)
581: bool(false)
582:
583: -- Testing fgetcsv() with file opened using r+b mode --
584: array(2) {
585: [0]=>
586: string(5) "water"
587: [1]=>
588: string(5) "fruit"
589: }
590: int(16)
591: bool(false)
592:
593: -- Testing fgetcsv() with file opened using r+t mode --
594: array(2) {
595: [0]=>
596: string(5) "water"
597: [1]=>
598: string(5) "fruit"
599: }
600: int(16)
601: bool(false)
602:
603: -- Testing fgetcsv() with file opened using a+ mode --
604: array(2) {
605: [0]=>
606: string(5) "water"
607: [1]=>
608: string(5) "fruit"
609: }
610: int(16)
611: bool(false)
612:
613: -- Testing fgetcsv() with file opened using a+b mode --
614: array(2) {
615: [0]=>
616: string(5) "water"
617: [1]=>
618: string(5) "fruit"
619: }
620: int(16)
621: bool(false)
622:
623: -- Testing fgetcsv() with file opened using a+t mode --
624: array(2) {
625: [0]=>
626: string(5) "water"
627: [1]=>
628: string(5) "fruit"
629: }
630: int(16)
631: bool(false)
632:
633: -- Testing fgetcsv() with file opened using w+ mode --
634: array(2) {
635: [0]=>
636: string(5) "water"
637: [1]=>
638: string(5) "fruit"
639: }
640: int(16)
641: bool(false)
642:
643: -- Testing fgetcsv() with file opened using w+b mode --
644: array(2) {
645: [0]=>
646: string(5) "water"
647: [1]=>
648: string(5) "fruit"
649: }
650: int(16)
651: bool(false)
652:
653: -- Testing fgetcsv() with file opened using w+t mode --
654: array(2) {
655: [0]=>
656: string(5) "water"
657: [1]=>
658: string(5) "fruit"
659: }
660: int(16)
661: bool(false)
662:
663: -- Testing fgetcsv() with file opened using x+ mode --
664: array(2) {
665: [0]=>
666: string(5) "water"
667: [1]=>
668: string(5) "fruit"
669: }
670: int(16)
671: bool(false)
672:
673: -- Testing fgetcsv() with file opened using x+b mode --
674: array(2) {
675: [0]=>
676: string(5) "water"
677: [1]=>
678: string(5) "fruit"
679: }
680: int(16)
681: bool(false)
682:
683: -- Testing fgetcsv() with file opened using x+t mode --
684: array(2) {
685: [0]=>
686: string(5) "water"
687: [1]=>
688: string(5) "fruit"
689: }
690: int(16)
691: bool(false)
692:
693: -- Testing fgetcsv() with file opened using r mode --
694: array(2) {
695: [0]=>
696: string(11) "water=fruit"
697: [1]=>
698: string(0) ""
699: }
700: int(16)
701: bool(false)
702:
703: -- Testing fgetcsv() with file opened using rb mode --
704: array(2) {
705: [0]=>
706: string(11) "water=fruit"
707: [1]=>
708: string(0) ""
709: }
710: int(16)
711: bool(false)
712:
713: -- Testing fgetcsv() with file opened using rt mode --
714: array(2) {
715: [0]=>
716: string(11) "water=fruit"
717: [1]=>
718: string(0) ""
719: }
720: int(16)
721: bool(false)
722:
723: -- Testing fgetcsv() with file opened using r+ mode --
724: array(2) {
725: [0]=>
726: string(11) "water=fruit"
727: [1]=>
728: string(0) ""
729: }
730: int(16)
731: bool(false)
732:
733: -- Testing fgetcsv() with file opened using r+b mode --
734: array(2) {
735: [0]=>
736: string(11) "water=fruit"
737: [1]=>
738: string(0) ""
739: }
740: int(16)
741: bool(false)
742:
743: -- Testing fgetcsv() with file opened using r+t mode --
744: array(2) {
745: [0]=>
746: string(11) "water=fruit"
747: [1]=>
748: string(0) ""
749: }
750: int(16)
751: bool(false)
752:
753: -- Testing fgetcsv() with file opened using a+ mode --
754: array(2) {
755: [0]=>
756: string(11) "water=fruit"
757: [1]=>
758: string(0) ""
759: }
760: int(16)
761: bool(false)
762:
763: -- Testing fgetcsv() with file opened using a+b mode --
764: array(2) {
765: [0]=>
766: string(11) "water=fruit"
767: [1]=>
768: string(0) ""
769: }
770: int(16)
771: bool(false)
772:
773: -- Testing fgetcsv() with file opened using a+t mode --
774: array(2) {
775: [0]=>
776: string(11) "water=fruit"
777: [1]=>
778: string(0) ""
779: }
780: int(16)
781: bool(false)
782:
783: -- Testing fgetcsv() with file opened using w+ mode --
784: array(2) {
785: [0]=>
786: string(11) "water=fruit"
787: [1]=>
788: string(0) ""
789: }
790: int(16)
791: bool(false)
792:
793: -- Testing fgetcsv() with file opened using w+b mode --
794: array(2) {
795: [0]=>
796: string(11) "water=fruit"
797: [1]=>
798: string(0) ""
799: }
800: int(16)
801: bool(false)
802:
803: -- Testing fgetcsv() with file opened using w+t mode --
804: array(2) {
805: [0]=>
806: string(11) "water=fruit"
807: [1]=>
808: string(0) ""
809: }
810: int(16)
811: bool(false)
812:
813: -- Testing fgetcsv() with file opened using x+ mode --
814: array(2) {
815: [0]=>
816: string(11) "water=fruit"
817: [1]=>
818: string(0) ""
819: }
820: int(16)
821: bool(false)
822:
823: -- Testing fgetcsv() with file opened using x+b mode --
824: array(2) {
825: [0]=>
826: string(11) "water=fruit"
827: [1]=>
828: string(0) ""
829: }
830: int(16)
831: bool(false)
832:
833: -- Testing fgetcsv() with file opened using x+t mode --
834: array(2) {
835: [0]=>
836: string(11) "water=fruit"
837: [1]=>
838: string(0) ""
839: }
840: int(16)
841: bool(false)
842:
843: -- Testing fgetcsv() with file opened using r mode --
844: array(1) {
845: [0]=>
846: string(14) "water-fruitair"
847: }
848: int(18)
849: bool(false)
850:
851: -- Testing fgetcsv() with file opened using rb mode --
852: array(1) {
853: [0]=>
854: string(14) "water-fruitair"
855: }
856: int(18)
857: bool(false)
858:
859: -- Testing fgetcsv() with file opened using rt mode --
860: array(1) {
861: [0]=>
862: string(14) "water-fruitair"
863: }
864: int(18)
865: bool(false)
866:
867: -- Testing fgetcsv() with file opened using r+ mode --
868: array(1) {
869: [0]=>
870: string(14) "water-fruitair"
871: }
872: int(18)
873: bool(false)
874:
875: -- Testing fgetcsv() with file opened using r+b mode --
876: array(1) {
877: [0]=>
878: string(14) "water-fruitair"
879: }
880: int(18)
881: bool(false)
882:
883: -- Testing fgetcsv() with file opened using r+t mode --
884: array(1) {
885: [0]=>
886: string(14) "water-fruitair"
887: }
888: int(18)
889: bool(false)
890:
891: -- Testing fgetcsv() with file opened using a+ mode --
892: array(1) {
893: [0]=>
894: string(14) "water-fruitair"
895: }
896: int(18)
897: bool(false)
898:
899: -- Testing fgetcsv() with file opened using a+b mode --
900: array(1) {
901: [0]=>
902: string(14) "water-fruitair"
903: }
904: int(18)
905: bool(false)
906:
907: -- Testing fgetcsv() with file opened using a+t mode --
908: array(1) {
909: [0]=>
910: string(14) "water-fruitair"
911: }
912: int(18)
913: bool(false)
914:
915: -- Testing fgetcsv() with file opened using w+ mode --
916: array(1) {
917: [0]=>
918: string(14) "water-fruitair"
919: }
920: int(18)
921: bool(false)
922:
923: -- Testing fgetcsv() with file opened using w+b mode --
924: array(1) {
925: [0]=>
926: string(14) "water-fruitair"
927: }
928: int(18)
929: bool(false)
930:
931: -- Testing fgetcsv() with file opened using w+t mode --
932: array(1) {
933: [0]=>
934: string(14) "water-fruitair"
935: }
936: int(18)
937: bool(false)
938:
939: -- Testing fgetcsv() with file opened using x+ mode --
940: array(1) {
941: [0]=>
942: string(14) "water-fruitair"
943: }
944: int(18)
945: bool(false)
946:
947: -- Testing fgetcsv() with file opened using x+b mode --
948: array(1) {
949: [0]=>
950: string(14) "water-fruitair"
951: }
952: int(18)
953: bool(false)
954:
955: -- Testing fgetcsv() with file opened using x+t mode --
956: array(1) {
957: [0]=>
958: string(14) "water-fruitair"
959: }
960: int(18)
961: bool(false)
962:
963: -- Testing fgetcsv() with file opened using r mode --
964: array(3) {
965: [0]=>
966: string(11) "water-fruit"
967: [1]=>
968: string(3) "air"
969: [2]=>
970: string(0) ""
971: }
972: int(22)
973: bool(false)
974:
975: -- Testing fgetcsv() with file opened using rb mode --
976: array(3) {
977: [0]=>
978: string(11) "water-fruit"
979: [1]=>
980: string(3) "air"
981: [2]=>
982: string(0) ""
983: }
984: int(22)
985: bool(false)
986:
987: -- Testing fgetcsv() with file opened using rt mode --
988: array(3) {
989: [0]=>
990: string(11) "water-fruit"
991: [1]=>
992: string(3) "air"
993: [2]=>
994: string(0) ""
995: }
996: int(22)
997: bool(false)
998:
999: -- Testing fgetcsv() with file opened using r+ mode --
1000: array(3) {
1001: [0]=>
1002: string(11) "water-fruit"
1003: [1]=>
1004: string(3) "air"
1005: [2]=>
1006: string(0) ""
1007: }
1008: int(22)
1009: bool(false)
1010:
1011: -- Testing fgetcsv() with file opened using r+b mode --
1012: array(3) {
1013: [0]=>
1014: string(11) "water-fruit"
1015: [1]=>
1016: string(3) "air"
1017: [2]=>
1018: string(0) ""
1019: }
1020: int(22)
1021: bool(false)
1022:
1023: -- Testing fgetcsv() with file opened using r+t mode --
1024: array(3) {
1025: [0]=>
1026: string(11) "water-fruit"
1027: [1]=>
1028: string(3) "air"
1029: [2]=>
1030: string(0) ""
1031: }
1032: int(22)
1033: bool(false)
1034:
1035: -- Testing fgetcsv() with file opened using a+ mode --
1036: array(3) {
1037: [0]=>
1038: string(11) "water-fruit"
1039: [1]=>
1040: string(3) "air"
1041: [2]=>
1042: string(0) ""
1043: }
1044: int(22)
1045: bool(false)
1046:
1047: -- Testing fgetcsv() with file opened using a+b mode --
1048: array(3) {
1049: [0]=>
1050: string(11) "water-fruit"
1051: [1]=>
1052: string(3) "air"
1053: [2]=>
1054: string(0) ""
1055: }
1056: int(22)
1057: bool(false)
1058:
1059: -- Testing fgetcsv() with file opened using a+t mode --
1060: array(3) {
1061: [0]=>
1062: string(11) "water-fruit"
1063: [1]=>
1064: string(3) "air"
1065: [2]=>
1066: string(0) ""
1067: }
1068: int(22)
1069: bool(false)
1070:
1071: -- Testing fgetcsv() with file opened using w+ mode --
1072: array(3) {
1073: [0]=>
1074: string(11) "water-fruit"
1075: [1]=>
1076: string(3) "air"
1077: [2]=>
1078: string(0) ""
1079: }
1080: int(22)
1081: bool(false)
1082:
1083: -- Testing fgetcsv() with file opened using w+b mode --
1084: array(3) {
1085: [0]=>
1086: string(11) "water-fruit"
1087: [1]=>
1088: string(3) "air"
1089: [2]=>
1090: string(0) ""
1091: }
1092: int(22)
1093: bool(false)
1094:
1095: -- Testing fgetcsv() with file opened using w+t mode --
1096: array(3) {
1097: [0]=>
1098: string(11) "water-fruit"
1099: [1]=>
1100: string(3) "air"
1101: [2]=>
1102: string(0) ""
1103: }
1104: int(22)
1105: bool(false)
1106:
1107: -- Testing fgetcsv() with file opened using x+ mode --
1108: array(3) {
1109: [0]=>
1110: string(11) "water-fruit"
1111: [1]=>
1112: string(3) "air"
1113: [2]=>
1114: string(0) ""
1115: }
1116: int(22)
1117: bool(false)
1118:
1119: -- Testing fgetcsv() with file opened using x+b mode --
1120: array(3) {
1121: [0]=>
1122: string(11) "water-fruit"
1123: [1]=>
1124: string(3) "air"
1125: [2]=>
1126: string(0) ""
1127: }
1128: int(22)
1129: bool(false)
1130:
1131: -- Testing fgetcsv() with file opened using x+t mode --
1132: array(3) {
1133: [0]=>
1134: string(11) "water-fruit"
1135: [1]=>
1136: string(3) "air"
1137: [2]=>
1138: string(0) ""
1139: }
1140: int(22)
1141: bool(false)
1142:
1143: -- Testing fgetcsv() with file opened using r mode --
1144: array(6) {
1145: [0]=>
1146: string(4) """"""
1147: [1]=>
1148: string(1) """
1149: [2]=>
1150: string(1) ","
1151: [3]=>
1152: string(1) """
1153: [4]=>
1154: string(1) ","
1155: [5]=>
1156: string(4) ",,,,"
1157: }
1158: int(24)
1159: bool(false)
1160:
1161: -- Testing fgetcsv() with file opened using rb mode --
1162: array(6) {
1163: [0]=>
1164: string(4) """"""
1165: [1]=>
1166: string(1) """
1167: [2]=>
1168: string(1) ","
1169: [3]=>
1170: string(1) """
1171: [4]=>
1172: string(1) ","
1173: [5]=>
1174: string(4) ",,,,"
1175: }
1176: int(24)
1177: bool(false)
1178:
1179: -- Testing fgetcsv() with file opened using rt mode --
1180: array(6) {
1181: [0]=>
1182: string(4) """"""
1183: [1]=>
1184: string(1) """
1185: [2]=>
1186: string(1) ","
1187: [3]=>
1188: string(1) """
1189: [4]=>
1190: string(1) ","
1191: [5]=>
1192: string(4) ",,,,"
1193: }
1194: int(24)
1195: bool(false)
1196:
1197: -- Testing fgetcsv() with file opened using r+ mode --
1198: array(6) {
1199: [0]=>
1200: string(4) """"""
1201: [1]=>
1202: string(1) """
1203: [2]=>
1204: string(1) ","
1205: [3]=>
1206: string(1) """
1207: [4]=>
1208: string(1) ","
1209: [5]=>
1210: string(4) ",,,,"
1211: }
1212: int(24)
1213: bool(false)
1214:
1215: -- Testing fgetcsv() with file opened using r+b mode --
1216: array(6) {
1217: [0]=>
1218: string(4) """"""
1219: [1]=>
1220: string(1) """
1221: [2]=>
1222: string(1) ","
1223: [3]=>
1224: string(1) """
1225: [4]=>
1226: string(1) ","
1227: [5]=>
1228: string(4) ",,,,"
1229: }
1230: int(24)
1231: bool(false)
1232:
1233: -- Testing fgetcsv() with file opened using r+t mode --
1234: array(6) {
1235: [0]=>
1236: string(4) """"""
1237: [1]=>
1238: string(1) """
1239: [2]=>
1240: string(1) ","
1241: [3]=>
1242: string(1) """
1243: [4]=>
1244: string(1) ","
1245: [5]=>
1246: string(4) ",,,,"
1247: }
1248: int(24)
1249: bool(false)
1250:
1251: -- Testing fgetcsv() with file opened using a+ mode --
1252: array(6) {
1253: [0]=>
1254: string(4) """"""
1255: [1]=>
1256: string(1) """
1257: [2]=>
1258: string(1) ","
1259: [3]=>
1260: string(1) """
1261: [4]=>
1262: string(1) ","
1263: [5]=>
1264: string(4) ",,,,"
1265: }
1266: int(24)
1267: bool(false)
1268:
1269: -- Testing fgetcsv() with file opened using a+b mode --
1270: array(6) {
1271: [0]=>
1272: string(4) """"""
1273: [1]=>
1274: string(1) """
1275: [2]=>
1276: string(1) ","
1277: [3]=>
1278: string(1) """
1279: [4]=>
1280: string(1) ","
1281: [5]=>
1282: string(4) ",,,,"
1283: }
1284: int(24)
1285: bool(false)
1286:
1287: -- Testing fgetcsv() with file opened using a+t mode --
1288: array(6) {
1289: [0]=>
1290: string(4) """"""
1291: [1]=>
1292: string(1) """
1293: [2]=>
1294: string(1) ","
1295: [3]=>
1296: string(1) """
1297: [4]=>
1298: string(1) ","
1299: [5]=>
1300: string(4) ",,,,"
1301: }
1302: int(24)
1303: bool(false)
1304:
1305: -- Testing fgetcsv() with file opened using w+ mode --
1306: array(6) {
1307: [0]=>
1308: string(4) """"""
1309: [1]=>
1310: string(1) """
1311: [2]=>
1312: string(1) ","
1313: [3]=>
1314: string(1) """
1315: [4]=>
1316: string(1) ","
1317: [5]=>
1318: string(4) ",,,,"
1319: }
1320: int(24)
1321: bool(false)
1322:
1323: -- Testing fgetcsv() with file opened using w+b mode --
1324: array(6) {
1325: [0]=>
1326: string(4) """"""
1327: [1]=>
1328: string(1) """
1329: [2]=>
1330: string(1) ","
1331: [3]=>
1332: string(1) """
1333: [4]=>
1334: string(1) ","
1335: [5]=>
1336: string(4) ",,,,"
1337: }
1338: int(24)
1339: bool(false)
1340:
1341: -- Testing fgetcsv() with file opened using w+t mode --
1342: array(6) {
1343: [0]=>
1344: string(4) """"""
1345: [1]=>
1346: string(1) """
1347: [2]=>
1348: string(1) ","
1349: [3]=>
1350: string(1) """
1351: [4]=>
1352: string(1) ","
1353: [5]=>
1354: string(4) ",,,,"
1355: }
1356: int(24)
1357: bool(false)
1358:
1359: -- Testing fgetcsv() with file opened using x+ mode --
1360: array(6) {
1361: [0]=>
1362: string(4) """"""
1363: [1]=>
1364: string(1) """
1365: [2]=>
1366: string(1) ","
1367: [3]=>
1368: string(1) """
1369: [4]=>
1370: string(1) ","
1371: [5]=>
1372: string(4) ",,,,"
1373: }
1374: int(24)
1375: bool(false)
1376:
1377: -- Testing fgetcsv() with file opened using x+b mode --
1378: array(6) {
1379: [0]=>
1380: string(4) """"""
1381: [1]=>
1382: string(1) """
1383: [2]=>
1384: string(1) ","
1385: [3]=>
1386: string(1) """
1387: [4]=>
1388: string(1) ","
1389: [5]=>
1390: string(4) ",,,,"
1391: }
1392: int(24)
1393: bool(false)
1394:
1395: -- Testing fgetcsv() with file opened using x+t mode --
1396: array(6) {
1397: [0]=>
1398: string(4) """"""
1399: [1]=>
1400: string(1) """
1401: [2]=>
1402: string(1) ","
1403: [3]=>
1404: string(1) """
1405: [4]=>
1406: string(1) ","
1407: [5]=>
1408: string(4) ",,,,"
1409: }
1410: int(24)
1411: bool(false)
1412: Done