fgetcsv_variation8.phpt 18 KB

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