fgetcsv_variation11.phpt 27 KB

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