fgetcsv_variation9.phpt 18 KB

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