fgetcsv_variation8.phpt 18 KB

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