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