fgetcsv_variation6.phpt 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345
  1. --TEST--
  2. Test fgetcsv() : usage variations - with length less than line size
  3. --FILE--
  4. <?php
  5. /*
  6. Testing fgetcsv() to read from a file when provided with the length argument
  7. value less than the line size
  8. */
  9. echo "*** Testing fgetcsv() : with length less than line size ***\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_variation6.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 blan 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 length as less than the actual size of the line
  64. fseek($file_handle, 0, SEEK_SET);
  65. var_dump( fgetcsv($file_handle, 9, $delimiter, $enclosure) );
  66. // check the file pointer position and if eof
  67. var_dump( ftell($file_handle) );
  68. var_dump( feof($file_handle) );
  69. // read rest of the line
  70. var_dump( fgetcsv($file_handle, 1024, $delimiter, $enclosure) );
  71. // check the file pointer position and if eof
  72. var_dump( ftell($file_handle) );
  73. var_dump( feof($file_handle) );
  74. // close the file
  75. fclose($file_handle);
  76. //delete file
  77. unlink($filename);
  78. } //end of mode loop
  79. } // end of foreach
  80. echo "Done\n";
  81. ?>
  82. --EXPECT--
  83. *** Testing fgetcsv() : with length less than line size ***
  84. -- Testing fgetcsv() with file opened using r mode --
  85. array(2) {
  86. [0]=>
  87. string(5) "water"
  88. [1]=>
  89. string(1) "f"
  90. }
  91. int(9)
  92. bool(false)
  93. array(1) {
  94. [0]=>
  95. string(4) "ruit"
  96. }
  97. int(14)
  98. bool(false)
  99. -- Testing fgetcsv() with file opened using rb mode --
  100. array(2) {
  101. [0]=>
  102. string(5) "water"
  103. [1]=>
  104. string(1) "f"
  105. }
  106. int(9)
  107. bool(false)
  108. array(1) {
  109. [0]=>
  110. string(4) "ruit"
  111. }
  112. int(14)
  113. bool(false)
  114. -- Testing fgetcsv() with file opened using rt mode --
  115. array(2) {
  116. [0]=>
  117. string(5) "water"
  118. [1]=>
  119. string(1) "f"
  120. }
  121. int(9)
  122. bool(false)
  123. array(1) {
  124. [0]=>
  125. string(4) "ruit"
  126. }
  127. int(14)
  128. bool(false)
  129. -- Testing fgetcsv() with file opened using r+ mode --
  130. array(2) {
  131. [0]=>
  132. string(5) "water"
  133. [1]=>
  134. string(1) "f"
  135. }
  136. int(9)
  137. bool(false)
  138. array(1) {
  139. [0]=>
  140. string(4) "ruit"
  141. }
  142. int(14)
  143. bool(false)
  144. -- Testing fgetcsv() with file opened using r+b mode --
  145. array(2) {
  146. [0]=>
  147. string(5) "water"
  148. [1]=>
  149. string(1) "f"
  150. }
  151. int(9)
  152. bool(false)
  153. array(1) {
  154. [0]=>
  155. string(4) "ruit"
  156. }
  157. int(14)
  158. bool(false)
  159. -- Testing fgetcsv() with file opened using r+t mode --
  160. array(2) {
  161. [0]=>
  162. string(5) "water"
  163. [1]=>
  164. string(1) "f"
  165. }
  166. int(9)
  167. bool(false)
  168. array(1) {
  169. [0]=>
  170. string(4) "ruit"
  171. }
  172. int(14)
  173. bool(false)
  174. -- Testing fgetcsv() with file opened using a+ mode --
  175. array(2) {
  176. [0]=>
  177. string(5) "water"
  178. [1]=>
  179. string(1) "f"
  180. }
  181. int(9)
  182. bool(false)
  183. array(1) {
  184. [0]=>
  185. string(4) "ruit"
  186. }
  187. int(14)
  188. bool(false)
  189. -- Testing fgetcsv() with file opened using a+b mode --
  190. array(2) {
  191. [0]=>
  192. string(5) "water"
  193. [1]=>
  194. string(1) "f"
  195. }
  196. int(9)
  197. bool(false)
  198. array(1) {
  199. [0]=>
  200. string(4) "ruit"
  201. }
  202. int(14)
  203. bool(false)
  204. -- Testing fgetcsv() with file opened using a+t mode --
  205. array(2) {
  206. [0]=>
  207. string(5) "water"
  208. [1]=>
  209. string(1) "f"
  210. }
  211. int(9)
  212. bool(false)
  213. array(1) {
  214. [0]=>
  215. string(4) "ruit"
  216. }
  217. int(14)
  218. bool(false)
  219. -- Testing fgetcsv() with file opened using w+ mode --
  220. array(2) {
  221. [0]=>
  222. string(5) "water"
  223. [1]=>
  224. string(1) "f"
  225. }
  226. int(9)
  227. bool(false)
  228. array(1) {
  229. [0]=>
  230. string(4) "ruit"
  231. }
  232. int(14)
  233. bool(false)
  234. -- Testing fgetcsv() with file opened using w+b mode --
  235. array(2) {
  236. [0]=>
  237. string(5) "water"
  238. [1]=>
  239. string(1) "f"
  240. }
  241. int(9)
  242. bool(false)
  243. array(1) {
  244. [0]=>
  245. string(4) "ruit"
  246. }
  247. int(14)
  248. bool(false)
  249. -- Testing fgetcsv() with file opened using w+t mode --
  250. array(2) {
  251. [0]=>
  252. string(5) "water"
  253. [1]=>
  254. string(1) "f"
  255. }
  256. int(9)
  257. bool(false)
  258. array(1) {
  259. [0]=>
  260. string(4) "ruit"
  261. }
  262. int(14)
  263. bool(false)
  264. -- Testing fgetcsv() with file opened using x+ mode --
  265. array(2) {
  266. [0]=>
  267. string(5) "water"
  268. [1]=>
  269. string(1) "f"
  270. }
  271. int(9)
  272. bool(false)
  273. array(1) {
  274. [0]=>
  275. string(4) "ruit"
  276. }
  277. int(14)
  278. bool(false)
  279. -- Testing fgetcsv() with file opened using x+b mode --
  280. array(2) {
  281. [0]=>
  282. string(5) "water"
  283. [1]=>
  284. string(1) "f"
  285. }
  286. int(9)
  287. bool(false)
  288. array(1) {
  289. [0]=>
  290. string(4) "ruit"
  291. }
  292. int(14)
  293. bool(false)
  294. -- Testing fgetcsv() with file opened using x+t mode --
  295. array(2) {
  296. [0]=>
  297. string(5) "water"
  298. [1]=>
  299. string(1) "f"
  300. }
  301. int(9)
  302. bool(false)
  303. array(1) {
  304. [0]=>
  305. string(4) "ruit"
  306. }
  307. int(14)
  308. bool(false)
  309. -- Testing fgetcsv() with file opened using r mode --
  310. array(2) {
  311. [0]=>
  312. string(5) "water"
  313. [1]=>
  314. string(5) "fruit"
  315. }
  316. int(16)
  317. bool(false)
  318. array(1) {
  319. [0]=>
  320. string(39) "This is line of text without csv fields"
  321. }
  322. int(56)
  323. bool(false)
  324. -- Testing fgetcsv() with file opened using rb mode --
  325. array(2) {
  326. [0]=>
  327. string(5) "water"
  328. [1]=>
  329. string(5) "fruit"
  330. }
  331. int(16)
  332. bool(false)
  333. array(1) {
  334. [0]=>
  335. string(39) "This is line of text without csv fields"
  336. }
  337. int(56)
  338. bool(false)
  339. -- Testing fgetcsv() with file opened using rt mode --
  340. array(2) {
  341. [0]=>
  342. string(5) "water"
  343. [1]=>
  344. string(5) "fruit"
  345. }
  346. int(16)
  347. bool(false)
  348. array(1) {
  349. [0]=>
  350. string(39) "This is line of text without csv fields"
  351. }
  352. int(56)
  353. bool(false)
  354. -- Testing fgetcsv() with file opened using r+ mode --
  355. array(2) {
  356. [0]=>
  357. string(5) "water"
  358. [1]=>
  359. string(5) "fruit"
  360. }
  361. int(16)
  362. bool(false)
  363. array(1) {
  364. [0]=>
  365. string(39) "This is line of text without csv fields"
  366. }
  367. int(56)
  368. bool(false)
  369. -- Testing fgetcsv() with file opened using r+b mode --
  370. array(2) {
  371. [0]=>
  372. string(5) "water"
  373. [1]=>
  374. string(5) "fruit"
  375. }
  376. int(16)
  377. bool(false)
  378. array(1) {
  379. [0]=>
  380. string(39) "This is line of text without csv fields"
  381. }
  382. int(56)
  383. bool(false)
  384. -- Testing fgetcsv() with file opened using r+t mode --
  385. array(2) {
  386. [0]=>
  387. string(5) "water"
  388. [1]=>
  389. string(5) "fruit"
  390. }
  391. int(16)
  392. bool(false)
  393. array(1) {
  394. [0]=>
  395. string(39) "This is line of text without csv fields"
  396. }
  397. int(56)
  398. bool(false)
  399. -- Testing fgetcsv() with file opened using a+ mode --
  400. array(2) {
  401. [0]=>
  402. string(5) "water"
  403. [1]=>
  404. string(5) "fruit"
  405. }
  406. int(16)
  407. bool(false)
  408. array(1) {
  409. [0]=>
  410. string(39) "This is line of text without csv fields"
  411. }
  412. int(56)
  413. bool(false)
  414. -- Testing fgetcsv() with file opened using a+b mode --
  415. array(2) {
  416. [0]=>
  417. string(5) "water"
  418. [1]=>
  419. string(5) "fruit"
  420. }
  421. int(16)
  422. bool(false)
  423. array(1) {
  424. [0]=>
  425. string(39) "This is line of text without csv fields"
  426. }
  427. int(56)
  428. bool(false)
  429. -- Testing fgetcsv() with file opened using a+t mode --
  430. array(2) {
  431. [0]=>
  432. string(5) "water"
  433. [1]=>
  434. string(5) "fruit"
  435. }
  436. int(16)
  437. bool(false)
  438. array(1) {
  439. [0]=>
  440. string(39) "This is line of text without csv fields"
  441. }
  442. int(56)
  443. bool(false)
  444. -- Testing fgetcsv() with file opened using w+ mode --
  445. array(2) {
  446. [0]=>
  447. string(5) "water"
  448. [1]=>
  449. string(5) "fruit"
  450. }
  451. int(16)
  452. bool(false)
  453. array(1) {
  454. [0]=>
  455. string(39) "This is line of text without csv fields"
  456. }
  457. int(56)
  458. bool(false)
  459. -- Testing fgetcsv() with file opened using w+b mode --
  460. array(2) {
  461. [0]=>
  462. string(5) "water"
  463. [1]=>
  464. string(5) "fruit"
  465. }
  466. int(16)
  467. bool(false)
  468. array(1) {
  469. [0]=>
  470. string(39) "This is line of text without csv fields"
  471. }
  472. int(56)
  473. bool(false)
  474. -- Testing fgetcsv() with file opened using w+t mode --
  475. array(2) {
  476. [0]=>
  477. string(5) "water"
  478. [1]=>
  479. string(5) "fruit"
  480. }
  481. int(16)
  482. bool(false)
  483. array(1) {
  484. [0]=>
  485. string(39) "This is line of text without csv fields"
  486. }
  487. int(56)
  488. bool(false)
  489. -- Testing fgetcsv() with file opened using x+ mode --
  490. array(2) {
  491. [0]=>
  492. string(5) "water"
  493. [1]=>
  494. string(5) "fruit"
  495. }
  496. int(16)
  497. bool(false)
  498. array(1) {
  499. [0]=>
  500. string(39) "This is line of text without csv fields"
  501. }
  502. int(56)
  503. bool(false)
  504. -- Testing fgetcsv() with file opened using x+b mode --
  505. array(2) {
  506. [0]=>
  507. string(5) "water"
  508. [1]=>
  509. string(5) "fruit"
  510. }
  511. int(16)
  512. bool(false)
  513. array(1) {
  514. [0]=>
  515. string(39) "This is line of text without csv fields"
  516. }
  517. int(56)
  518. bool(false)
  519. -- Testing fgetcsv() with file opened using x+t mode --
  520. array(2) {
  521. [0]=>
  522. string(5) "water"
  523. [1]=>
  524. string(5) "fruit"
  525. }
  526. int(16)
  527. bool(false)
  528. array(1) {
  529. [0]=>
  530. string(39) "This is line of text without csv fields"
  531. }
  532. int(56)
  533. bool(false)
  534. -- Testing fgetcsv() with file opened using r mode --
  535. array(2) {
  536. [0]=>
  537. string(5) "water"
  538. [1]=>
  539. string(5) "fruit"
  540. }
  541. int(16)
  542. bool(false)
  543. array(8) {
  544. [0]=>
  545. string(4) "This"
  546. [1]=>
  547. string(2) "is"
  548. [2]=>
  549. string(4) "line"
  550. [3]=>
  551. string(2) "of"
  552. [4]=>
  553. string(4) "text"
  554. [5]=>
  555. string(7) "without"
  556. [6]=>
  557. string(3) "csv"
  558. [7]=>
  559. string(6) "fields"
  560. }
  561. int(56)
  562. bool(false)
  563. -- Testing fgetcsv() with file opened using rb mode --
  564. array(2) {
  565. [0]=>
  566. string(5) "water"
  567. [1]=>
  568. string(5) "fruit"
  569. }
  570. int(16)
  571. bool(false)
  572. array(8) {
  573. [0]=>
  574. string(4) "This"
  575. [1]=>
  576. string(2) "is"
  577. [2]=>
  578. string(4) "line"
  579. [3]=>
  580. string(2) "of"
  581. [4]=>
  582. string(4) "text"
  583. [5]=>
  584. string(7) "without"
  585. [6]=>
  586. string(3) "csv"
  587. [7]=>
  588. string(6) "fields"
  589. }
  590. int(56)
  591. bool(false)
  592. -- Testing fgetcsv() with file opened using rt mode --
  593. array(2) {
  594. [0]=>
  595. string(5) "water"
  596. [1]=>
  597. string(5) "fruit"
  598. }
  599. int(16)
  600. bool(false)
  601. array(8) {
  602. [0]=>
  603. string(4) "This"
  604. [1]=>
  605. string(2) "is"
  606. [2]=>
  607. string(4) "line"
  608. [3]=>
  609. string(2) "of"
  610. [4]=>
  611. string(4) "text"
  612. [5]=>
  613. string(7) "without"
  614. [6]=>
  615. string(3) "csv"
  616. [7]=>
  617. string(6) "fields"
  618. }
  619. int(56)
  620. bool(false)
  621. -- Testing fgetcsv() with file opened using r+ mode --
  622. array(2) {
  623. [0]=>
  624. string(5) "water"
  625. [1]=>
  626. string(5) "fruit"
  627. }
  628. int(16)
  629. bool(false)
  630. array(8) {
  631. [0]=>
  632. string(4) "This"
  633. [1]=>
  634. string(2) "is"
  635. [2]=>
  636. string(4) "line"
  637. [3]=>
  638. string(2) "of"
  639. [4]=>
  640. string(4) "text"
  641. [5]=>
  642. string(7) "without"
  643. [6]=>
  644. string(3) "csv"
  645. [7]=>
  646. string(6) "fields"
  647. }
  648. int(56)
  649. bool(false)
  650. -- Testing fgetcsv() with file opened using r+b mode --
  651. array(2) {
  652. [0]=>
  653. string(5) "water"
  654. [1]=>
  655. string(5) "fruit"
  656. }
  657. int(16)
  658. bool(false)
  659. array(8) {
  660. [0]=>
  661. string(4) "This"
  662. [1]=>
  663. string(2) "is"
  664. [2]=>
  665. string(4) "line"
  666. [3]=>
  667. string(2) "of"
  668. [4]=>
  669. string(4) "text"
  670. [5]=>
  671. string(7) "without"
  672. [6]=>
  673. string(3) "csv"
  674. [7]=>
  675. string(6) "fields"
  676. }
  677. int(56)
  678. bool(false)
  679. -- Testing fgetcsv() with file opened using r+t mode --
  680. array(2) {
  681. [0]=>
  682. string(5) "water"
  683. [1]=>
  684. string(5) "fruit"
  685. }
  686. int(16)
  687. bool(false)
  688. array(8) {
  689. [0]=>
  690. string(4) "This"
  691. [1]=>
  692. string(2) "is"
  693. [2]=>
  694. string(4) "line"
  695. [3]=>
  696. string(2) "of"
  697. [4]=>
  698. string(4) "text"
  699. [5]=>
  700. string(7) "without"
  701. [6]=>
  702. string(3) "csv"
  703. [7]=>
  704. string(6) "fields"
  705. }
  706. int(56)
  707. bool(false)
  708. -- Testing fgetcsv() with file opened using a+ mode --
  709. array(2) {
  710. [0]=>
  711. string(5) "water"
  712. [1]=>
  713. string(5) "fruit"
  714. }
  715. int(16)
  716. bool(false)
  717. array(8) {
  718. [0]=>
  719. string(4) "This"
  720. [1]=>
  721. string(2) "is"
  722. [2]=>
  723. string(4) "line"
  724. [3]=>
  725. string(2) "of"
  726. [4]=>
  727. string(4) "text"
  728. [5]=>
  729. string(7) "without"
  730. [6]=>
  731. string(3) "csv"
  732. [7]=>
  733. string(6) "fields"
  734. }
  735. int(56)
  736. bool(false)
  737. -- Testing fgetcsv() with file opened using a+b mode --
  738. array(2) {
  739. [0]=>
  740. string(5) "water"
  741. [1]=>
  742. string(5) "fruit"
  743. }
  744. int(16)
  745. bool(false)
  746. array(8) {
  747. [0]=>
  748. string(4) "This"
  749. [1]=>
  750. string(2) "is"
  751. [2]=>
  752. string(4) "line"
  753. [3]=>
  754. string(2) "of"
  755. [4]=>
  756. string(4) "text"
  757. [5]=>
  758. string(7) "without"
  759. [6]=>
  760. string(3) "csv"
  761. [7]=>
  762. string(6) "fields"
  763. }
  764. int(56)
  765. bool(false)
  766. -- Testing fgetcsv() with file opened using a+t mode --
  767. array(2) {
  768. [0]=>
  769. string(5) "water"
  770. [1]=>
  771. string(5) "fruit"
  772. }
  773. int(16)
  774. bool(false)
  775. array(8) {
  776. [0]=>
  777. string(4) "This"
  778. [1]=>
  779. string(2) "is"
  780. [2]=>
  781. string(4) "line"
  782. [3]=>
  783. string(2) "of"
  784. [4]=>
  785. string(4) "text"
  786. [5]=>
  787. string(7) "without"
  788. [6]=>
  789. string(3) "csv"
  790. [7]=>
  791. string(6) "fields"
  792. }
  793. int(56)
  794. bool(false)
  795. -- Testing fgetcsv() with file opened using w+ mode --
  796. array(2) {
  797. [0]=>
  798. string(5) "water"
  799. [1]=>
  800. string(5) "fruit"
  801. }
  802. int(16)
  803. bool(false)
  804. array(8) {
  805. [0]=>
  806. string(4) "This"
  807. [1]=>
  808. string(2) "is"
  809. [2]=>
  810. string(4) "line"
  811. [3]=>
  812. string(2) "of"
  813. [4]=>
  814. string(4) "text"
  815. [5]=>
  816. string(7) "without"
  817. [6]=>
  818. string(3) "csv"
  819. [7]=>
  820. string(6) "fields"
  821. }
  822. int(56)
  823. bool(false)
  824. -- Testing fgetcsv() with file opened using w+b mode --
  825. array(2) {
  826. [0]=>
  827. string(5) "water"
  828. [1]=>
  829. string(5) "fruit"
  830. }
  831. int(16)
  832. bool(false)
  833. array(8) {
  834. [0]=>
  835. string(4) "This"
  836. [1]=>
  837. string(2) "is"
  838. [2]=>
  839. string(4) "line"
  840. [3]=>
  841. string(2) "of"
  842. [4]=>
  843. string(4) "text"
  844. [5]=>
  845. string(7) "without"
  846. [6]=>
  847. string(3) "csv"
  848. [7]=>
  849. string(6) "fields"
  850. }
  851. int(56)
  852. bool(false)
  853. -- Testing fgetcsv() with file opened using w+t mode --
  854. array(2) {
  855. [0]=>
  856. string(5) "water"
  857. [1]=>
  858. string(5) "fruit"
  859. }
  860. int(16)
  861. bool(false)
  862. array(8) {
  863. [0]=>
  864. string(4) "This"
  865. [1]=>
  866. string(2) "is"
  867. [2]=>
  868. string(4) "line"
  869. [3]=>
  870. string(2) "of"
  871. [4]=>
  872. string(4) "text"
  873. [5]=>
  874. string(7) "without"
  875. [6]=>
  876. string(3) "csv"
  877. [7]=>
  878. string(6) "fields"
  879. }
  880. int(56)
  881. bool(false)
  882. -- Testing fgetcsv() with file opened using x+ mode --
  883. array(2) {
  884. [0]=>
  885. string(5) "water"
  886. [1]=>
  887. string(5) "fruit"
  888. }
  889. int(16)
  890. bool(false)
  891. array(8) {
  892. [0]=>
  893. string(4) "This"
  894. [1]=>
  895. string(2) "is"
  896. [2]=>
  897. string(4) "line"
  898. [3]=>
  899. string(2) "of"
  900. [4]=>
  901. string(4) "text"
  902. [5]=>
  903. string(7) "without"
  904. [6]=>
  905. string(3) "csv"
  906. [7]=>
  907. string(6) "fields"
  908. }
  909. int(56)
  910. bool(false)
  911. -- Testing fgetcsv() with file opened using x+b mode --
  912. array(2) {
  913. [0]=>
  914. string(5) "water"
  915. [1]=>
  916. string(5) "fruit"
  917. }
  918. int(16)
  919. bool(false)
  920. array(8) {
  921. [0]=>
  922. string(4) "This"
  923. [1]=>
  924. string(2) "is"
  925. [2]=>
  926. string(4) "line"
  927. [3]=>
  928. string(2) "of"
  929. [4]=>
  930. string(4) "text"
  931. [5]=>
  932. string(7) "without"
  933. [6]=>
  934. string(3) "csv"
  935. [7]=>
  936. string(6) "fields"
  937. }
  938. int(56)
  939. bool(false)
  940. -- Testing fgetcsv() with file opened using x+t mode --
  941. array(2) {
  942. [0]=>
  943. string(5) "water"
  944. [1]=>
  945. string(5) "fruit"
  946. }
  947. int(16)
  948. bool(false)
  949. array(8) {
  950. [0]=>
  951. string(4) "This"
  952. [1]=>
  953. string(2) "is"
  954. [2]=>
  955. string(4) "line"
  956. [3]=>
  957. string(2) "of"
  958. [4]=>
  959. string(4) "text"
  960. [5]=>
  961. string(7) "without"
  962. [6]=>
  963. string(3) "csv"
  964. [7]=>
  965. string(6) "fields"
  966. }
  967. int(56)
  968. bool(false)
  969. -- Testing fgetcsv() with file opened using r mode --
  970. array(2) {
  971. [0]=>
  972. string(5) "water"
  973. [1]=>
  974. string(5) "fruit"
  975. }
  976. int(16)
  977. bool(false)
  978. array(1) {
  979. [0]=>
  980. string(39) "This is line of text without csv fields"
  981. }
  982. int(56)
  983. bool(false)
  984. -- Testing fgetcsv() with file opened using rb mode --
  985. array(2) {
  986. [0]=>
  987. string(5) "water"
  988. [1]=>
  989. string(5) "fruit"
  990. }
  991. int(16)
  992. bool(false)
  993. array(1) {
  994. [0]=>
  995. string(39) "This is line of text without csv fields"
  996. }
  997. int(56)
  998. bool(false)
  999. -- Testing fgetcsv() with file opened using rt mode --
  1000. array(2) {
  1001. [0]=>
  1002. string(5) "water"
  1003. [1]=>
  1004. string(5) "fruit"
  1005. }
  1006. int(16)
  1007. bool(false)
  1008. array(1) {
  1009. [0]=>
  1010. string(39) "This is line of text without csv fields"
  1011. }
  1012. int(56)
  1013. bool(false)
  1014. -- Testing fgetcsv() with file opened using r+ mode --
  1015. array(2) {
  1016. [0]=>
  1017. string(5) "water"
  1018. [1]=>
  1019. string(5) "fruit"
  1020. }
  1021. int(16)
  1022. bool(false)
  1023. array(1) {
  1024. [0]=>
  1025. string(39) "This is line of text without csv fields"
  1026. }
  1027. int(56)
  1028. bool(false)
  1029. -- Testing fgetcsv() with file opened using r+b mode --
  1030. array(2) {
  1031. [0]=>
  1032. string(5) "water"
  1033. [1]=>
  1034. string(5) "fruit"
  1035. }
  1036. int(16)
  1037. bool(false)
  1038. array(1) {
  1039. [0]=>
  1040. string(39) "This is line of text without csv fields"
  1041. }
  1042. int(56)
  1043. bool(false)
  1044. -- Testing fgetcsv() with file opened using r+t mode --
  1045. array(2) {
  1046. [0]=>
  1047. string(5) "water"
  1048. [1]=>
  1049. string(5) "fruit"
  1050. }
  1051. int(16)
  1052. bool(false)
  1053. array(1) {
  1054. [0]=>
  1055. string(39) "This is line of text without csv fields"
  1056. }
  1057. int(56)
  1058. bool(false)
  1059. -- Testing fgetcsv() with file opened using a+ mode --
  1060. array(2) {
  1061. [0]=>
  1062. string(5) "water"
  1063. [1]=>
  1064. string(5) "fruit"
  1065. }
  1066. int(16)
  1067. bool(false)
  1068. array(1) {
  1069. [0]=>
  1070. string(39) "This is line of text without csv fields"
  1071. }
  1072. int(56)
  1073. bool(false)
  1074. -- Testing fgetcsv() with file opened using a+b mode --
  1075. array(2) {
  1076. [0]=>
  1077. string(5) "water"
  1078. [1]=>
  1079. string(5) "fruit"
  1080. }
  1081. int(16)
  1082. bool(false)
  1083. array(1) {
  1084. [0]=>
  1085. string(39) "This is line of text without csv fields"
  1086. }
  1087. int(56)
  1088. bool(false)
  1089. -- Testing fgetcsv() with file opened using a+t mode --
  1090. array(2) {
  1091. [0]=>
  1092. string(5) "water"
  1093. [1]=>
  1094. string(5) "fruit"
  1095. }
  1096. int(16)
  1097. bool(false)
  1098. array(1) {
  1099. [0]=>
  1100. string(39) "This is line of text without csv fields"
  1101. }
  1102. int(56)
  1103. bool(false)
  1104. -- Testing fgetcsv() with file opened using w+ mode --
  1105. array(2) {
  1106. [0]=>
  1107. string(5) "water"
  1108. [1]=>
  1109. string(5) "fruit"
  1110. }
  1111. int(16)
  1112. bool(false)
  1113. array(1) {
  1114. [0]=>
  1115. string(39) "This is line of text without csv fields"
  1116. }
  1117. int(56)
  1118. bool(false)
  1119. -- Testing fgetcsv() with file opened using w+b mode --
  1120. array(2) {
  1121. [0]=>
  1122. string(5) "water"
  1123. [1]=>
  1124. string(5) "fruit"
  1125. }
  1126. int(16)
  1127. bool(false)
  1128. array(1) {
  1129. [0]=>
  1130. string(39) "This is line of text without csv fields"
  1131. }
  1132. int(56)
  1133. bool(false)
  1134. -- Testing fgetcsv() with file opened using w+t mode --
  1135. array(2) {
  1136. [0]=>
  1137. string(5) "water"
  1138. [1]=>
  1139. string(5) "fruit"
  1140. }
  1141. int(16)
  1142. bool(false)
  1143. array(1) {
  1144. [0]=>
  1145. string(39) "This is line of text without csv fields"
  1146. }
  1147. int(56)
  1148. bool(false)
  1149. -- Testing fgetcsv() with file opened using x+ mode --
  1150. array(2) {
  1151. [0]=>
  1152. string(5) "water"
  1153. [1]=>
  1154. string(5) "fruit"
  1155. }
  1156. int(16)
  1157. bool(false)
  1158. array(1) {
  1159. [0]=>
  1160. string(39) "This is line of text without csv fields"
  1161. }
  1162. int(56)
  1163. bool(false)
  1164. -- Testing fgetcsv() with file opened using x+b mode --
  1165. array(2) {
  1166. [0]=>
  1167. string(5) "water"
  1168. [1]=>
  1169. string(5) "fruit"
  1170. }
  1171. int(16)
  1172. bool(false)
  1173. array(1) {
  1174. [0]=>
  1175. string(39) "This is line of text without csv fields"
  1176. }
  1177. int(56)
  1178. bool(false)
  1179. -- Testing fgetcsv() with file opened using x+t mode --
  1180. array(2) {
  1181. [0]=>
  1182. string(5) "water"
  1183. [1]=>
  1184. string(5) "fruit"
  1185. }
  1186. int(16)
  1187. bool(false)
  1188. array(1) {
  1189. [0]=>
  1190. string(39) "This is line of text without csv fields"
  1191. }
  1192. int(56)
  1193. bool(false)
  1194. -- Testing fgetcsv() with file opened using r mode --
  1195. array(1) {
  1196. [0]=>
  1197. string(6) "water="
  1198. }
  1199. int(9)
  1200. bool(false)
  1201. array(2) {
  1202. [0]=>
  1203. string(5) "fruit"
  1204. [1]=>
  1205. string(0) ""
  1206. }
  1207. int(16)
  1208. bool(false)
  1209. -- Testing fgetcsv() with file opened using rb mode --
  1210. array(1) {
  1211. [0]=>
  1212. string(6) "water="
  1213. }
  1214. int(9)
  1215. bool(false)
  1216. array(2) {
  1217. [0]=>
  1218. string(5) "fruit"
  1219. [1]=>
  1220. string(0) ""
  1221. }
  1222. int(16)
  1223. bool(false)
  1224. -- Testing fgetcsv() with file opened using rt mode --
  1225. array(1) {
  1226. [0]=>
  1227. string(6) "water="
  1228. }
  1229. int(9)
  1230. bool(false)
  1231. array(2) {
  1232. [0]=>
  1233. string(5) "fruit"
  1234. [1]=>
  1235. string(0) ""
  1236. }
  1237. int(16)
  1238. bool(false)
  1239. -- Testing fgetcsv() with file opened using r+ mode --
  1240. array(1) {
  1241. [0]=>
  1242. string(6) "water="
  1243. }
  1244. int(9)
  1245. bool(false)
  1246. array(2) {
  1247. [0]=>
  1248. string(5) "fruit"
  1249. [1]=>
  1250. string(0) ""
  1251. }
  1252. int(16)
  1253. bool(false)
  1254. -- Testing fgetcsv() with file opened using r+b mode --
  1255. array(1) {
  1256. [0]=>
  1257. string(6) "water="
  1258. }
  1259. int(9)
  1260. bool(false)
  1261. array(2) {
  1262. [0]=>
  1263. string(5) "fruit"
  1264. [1]=>
  1265. string(0) ""
  1266. }
  1267. int(16)
  1268. bool(false)
  1269. -- Testing fgetcsv() with file opened using r+t mode --
  1270. array(1) {
  1271. [0]=>
  1272. string(6) "water="
  1273. }
  1274. int(9)
  1275. bool(false)
  1276. array(2) {
  1277. [0]=>
  1278. string(5) "fruit"
  1279. [1]=>
  1280. string(0) ""
  1281. }
  1282. int(16)
  1283. bool(false)
  1284. -- Testing fgetcsv() with file opened using a+ mode --
  1285. array(1) {
  1286. [0]=>
  1287. string(6) "water="
  1288. }
  1289. int(9)
  1290. bool(false)
  1291. array(2) {
  1292. [0]=>
  1293. string(5) "fruit"
  1294. [1]=>
  1295. string(0) ""
  1296. }
  1297. int(16)
  1298. bool(false)
  1299. -- Testing fgetcsv() with file opened using a+b mode --
  1300. array(1) {
  1301. [0]=>
  1302. string(6) "water="
  1303. }
  1304. int(9)
  1305. bool(false)
  1306. array(2) {
  1307. [0]=>
  1308. string(5) "fruit"
  1309. [1]=>
  1310. string(0) ""
  1311. }
  1312. int(16)
  1313. bool(false)
  1314. -- Testing fgetcsv() with file opened using a+t mode --
  1315. array(1) {
  1316. [0]=>
  1317. string(6) "water="
  1318. }
  1319. int(9)
  1320. bool(false)
  1321. array(2) {
  1322. [0]=>
  1323. string(5) "fruit"
  1324. [1]=>
  1325. string(0) ""
  1326. }
  1327. int(16)
  1328. bool(false)
  1329. -- Testing fgetcsv() with file opened using w+ mode --
  1330. array(1) {
  1331. [0]=>
  1332. string(6) "water="
  1333. }
  1334. int(9)
  1335. bool(false)
  1336. array(2) {
  1337. [0]=>
  1338. string(5) "fruit"
  1339. [1]=>
  1340. string(0) ""
  1341. }
  1342. int(16)
  1343. bool(false)
  1344. -- Testing fgetcsv() with file opened using w+b mode --
  1345. array(1) {
  1346. [0]=>
  1347. string(6) "water="
  1348. }
  1349. int(9)
  1350. bool(false)
  1351. array(2) {
  1352. [0]=>
  1353. string(5) "fruit"
  1354. [1]=>
  1355. string(0) ""
  1356. }
  1357. int(16)
  1358. bool(false)
  1359. -- Testing fgetcsv() with file opened using w+t mode --
  1360. array(1) {
  1361. [0]=>
  1362. string(6) "water="
  1363. }
  1364. int(9)
  1365. bool(false)
  1366. array(2) {
  1367. [0]=>
  1368. string(5) "fruit"
  1369. [1]=>
  1370. string(0) ""
  1371. }
  1372. int(16)
  1373. bool(false)
  1374. -- Testing fgetcsv() with file opened using x+ mode --
  1375. array(1) {
  1376. [0]=>
  1377. string(6) "water="
  1378. }
  1379. int(9)
  1380. bool(false)
  1381. array(2) {
  1382. [0]=>
  1383. string(5) "fruit"
  1384. [1]=>
  1385. string(0) ""
  1386. }
  1387. int(16)
  1388. bool(false)
  1389. -- Testing fgetcsv() with file opened using x+b mode --
  1390. array(1) {
  1391. [0]=>
  1392. string(6) "water="
  1393. }
  1394. int(9)
  1395. bool(false)
  1396. array(2) {
  1397. [0]=>
  1398. string(5) "fruit"
  1399. [1]=>
  1400. string(0) ""
  1401. }
  1402. int(16)
  1403. bool(false)
  1404. -- Testing fgetcsv() with file opened using x+t mode --
  1405. array(1) {
  1406. [0]=>
  1407. string(6) "water="
  1408. }
  1409. int(9)
  1410. bool(false)
  1411. array(2) {
  1412. [0]=>
  1413. string(5) "fruit"
  1414. [1]=>
  1415. string(0) ""
  1416. }
  1417. int(16)
  1418. bool(false)
  1419. -- Testing fgetcsv() with file opened using r mode --
  1420. array(1) {
  1421. [0]=>
  1422. string(14) "water-fruitair"
  1423. }
  1424. int(18)
  1425. bool(false)
  1426. array(1) {
  1427. [0]=>
  1428. string(39) "This is line of text without csv fields"
  1429. }
  1430. int(58)
  1431. bool(false)
  1432. -- Testing fgetcsv() with file opened using rb mode --
  1433. array(1) {
  1434. [0]=>
  1435. string(14) "water-fruitair"
  1436. }
  1437. int(18)
  1438. bool(false)
  1439. array(1) {
  1440. [0]=>
  1441. string(39) "This is line of text without csv fields"
  1442. }
  1443. int(58)
  1444. bool(false)
  1445. -- Testing fgetcsv() with file opened using rt mode --
  1446. array(1) {
  1447. [0]=>
  1448. string(14) "water-fruitair"
  1449. }
  1450. int(18)
  1451. bool(false)
  1452. array(1) {
  1453. [0]=>
  1454. string(39) "This is line of text without csv fields"
  1455. }
  1456. int(58)
  1457. bool(false)
  1458. -- Testing fgetcsv() with file opened using r+ mode --
  1459. array(1) {
  1460. [0]=>
  1461. string(14) "water-fruitair"
  1462. }
  1463. int(18)
  1464. bool(false)
  1465. array(1) {
  1466. [0]=>
  1467. string(39) "This is line of text without csv fields"
  1468. }
  1469. int(58)
  1470. bool(false)
  1471. -- Testing fgetcsv() with file opened using r+b mode --
  1472. array(1) {
  1473. [0]=>
  1474. string(14) "water-fruitair"
  1475. }
  1476. int(18)
  1477. bool(false)
  1478. array(1) {
  1479. [0]=>
  1480. string(39) "This is line of text without csv fields"
  1481. }
  1482. int(58)
  1483. bool(false)
  1484. -- Testing fgetcsv() with file opened using r+t mode --
  1485. array(1) {
  1486. [0]=>
  1487. string(14) "water-fruitair"
  1488. }
  1489. int(18)
  1490. bool(false)
  1491. array(1) {
  1492. [0]=>
  1493. string(39) "This is line of text without csv fields"
  1494. }
  1495. int(58)
  1496. bool(false)
  1497. -- Testing fgetcsv() with file opened using a+ mode --
  1498. array(1) {
  1499. [0]=>
  1500. string(14) "water-fruitair"
  1501. }
  1502. int(18)
  1503. bool(false)
  1504. array(1) {
  1505. [0]=>
  1506. string(39) "This is line of text without csv fields"
  1507. }
  1508. int(58)
  1509. bool(false)
  1510. -- Testing fgetcsv() with file opened using a+b mode --
  1511. array(1) {
  1512. [0]=>
  1513. string(14) "water-fruitair"
  1514. }
  1515. int(18)
  1516. bool(false)
  1517. array(1) {
  1518. [0]=>
  1519. string(39) "This is line of text without csv fields"
  1520. }
  1521. int(58)
  1522. bool(false)
  1523. -- Testing fgetcsv() with file opened using a+t mode --
  1524. array(1) {
  1525. [0]=>
  1526. string(14) "water-fruitair"
  1527. }
  1528. int(18)
  1529. bool(false)
  1530. array(1) {
  1531. [0]=>
  1532. string(39) "This is line of text without csv fields"
  1533. }
  1534. int(58)
  1535. bool(false)
  1536. -- Testing fgetcsv() with file opened using w+ mode --
  1537. array(1) {
  1538. [0]=>
  1539. string(14) "water-fruitair"
  1540. }
  1541. int(18)
  1542. bool(false)
  1543. array(1) {
  1544. [0]=>
  1545. string(39) "This is line of text without csv fields"
  1546. }
  1547. int(58)
  1548. bool(false)
  1549. -- Testing fgetcsv() with file opened using w+b mode --
  1550. array(1) {
  1551. [0]=>
  1552. string(14) "water-fruitair"
  1553. }
  1554. int(18)
  1555. bool(false)
  1556. array(1) {
  1557. [0]=>
  1558. string(39) "This is line of text without csv fields"
  1559. }
  1560. int(58)
  1561. bool(false)
  1562. -- Testing fgetcsv() with file opened using w+t mode --
  1563. array(1) {
  1564. [0]=>
  1565. string(14) "water-fruitair"
  1566. }
  1567. int(18)
  1568. bool(false)
  1569. array(1) {
  1570. [0]=>
  1571. string(39) "This is line of text without csv fields"
  1572. }
  1573. int(58)
  1574. bool(false)
  1575. -- Testing fgetcsv() with file opened using x+ mode --
  1576. array(1) {
  1577. [0]=>
  1578. string(14) "water-fruitair"
  1579. }
  1580. int(18)
  1581. bool(false)
  1582. array(1) {
  1583. [0]=>
  1584. string(39) "This is line of text without csv fields"
  1585. }
  1586. int(58)
  1587. bool(false)
  1588. -- Testing fgetcsv() with file opened using x+b mode --
  1589. array(1) {
  1590. [0]=>
  1591. string(14) "water-fruitair"
  1592. }
  1593. int(18)
  1594. bool(false)
  1595. array(1) {
  1596. [0]=>
  1597. string(39) "This is line of text without csv fields"
  1598. }
  1599. int(58)
  1600. bool(false)
  1601. -- Testing fgetcsv() with file opened using x+t mode --
  1602. array(1) {
  1603. [0]=>
  1604. string(14) "water-fruitair"
  1605. }
  1606. int(18)
  1607. bool(false)
  1608. array(1) {
  1609. [0]=>
  1610. string(39) "This is line of text without csv fields"
  1611. }
  1612. int(58)
  1613. bool(false)
  1614. -- Testing fgetcsv() with file opened using r mode --
  1615. array(1) {
  1616. [0]=>
  1617. string(6) "water-"
  1618. }
  1619. int(9)
  1620. bool(false)
  1621. array(3) {
  1622. [0]=>
  1623. string(5) "fruit"
  1624. [1]=>
  1625. string(3) "air"
  1626. [2]=>
  1627. string(0) ""
  1628. }
  1629. int(22)
  1630. bool(false)
  1631. -- Testing fgetcsv() with file opened using rb mode --
  1632. array(1) {
  1633. [0]=>
  1634. string(6) "water-"
  1635. }
  1636. int(9)
  1637. bool(false)
  1638. array(3) {
  1639. [0]=>
  1640. string(5) "fruit"
  1641. [1]=>
  1642. string(3) "air"
  1643. [2]=>
  1644. string(0) ""
  1645. }
  1646. int(22)
  1647. bool(false)
  1648. -- Testing fgetcsv() with file opened using rt mode --
  1649. array(1) {
  1650. [0]=>
  1651. string(6) "water-"
  1652. }
  1653. int(9)
  1654. bool(false)
  1655. array(3) {
  1656. [0]=>
  1657. string(5) "fruit"
  1658. [1]=>
  1659. string(3) "air"
  1660. [2]=>
  1661. string(0) ""
  1662. }
  1663. int(22)
  1664. bool(false)
  1665. -- Testing fgetcsv() with file opened using r+ mode --
  1666. array(1) {
  1667. [0]=>
  1668. string(6) "water-"
  1669. }
  1670. int(9)
  1671. bool(false)
  1672. array(3) {
  1673. [0]=>
  1674. string(5) "fruit"
  1675. [1]=>
  1676. string(3) "air"
  1677. [2]=>
  1678. string(0) ""
  1679. }
  1680. int(22)
  1681. bool(false)
  1682. -- Testing fgetcsv() with file opened using r+b mode --
  1683. array(1) {
  1684. [0]=>
  1685. string(6) "water-"
  1686. }
  1687. int(9)
  1688. bool(false)
  1689. array(3) {
  1690. [0]=>
  1691. string(5) "fruit"
  1692. [1]=>
  1693. string(3) "air"
  1694. [2]=>
  1695. string(0) ""
  1696. }
  1697. int(22)
  1698. bool(false)
  1699. -- Testing fgetcsv() with file opened using r+t mode --
  1700. array(1) {
  1701. [0]=>
  1702. string(6) "water-"
  1703. }
  1704. int(9)
  1705. bool(false)
  1706. array(3) {
  1707. [0]=>
  1708. string(5) "fruit"
  1709. [1]=>
  1710. string(3) "air"
  1711. [2]=>
  1712. string(0) ""
  1713. }
  1714. int(22)
  1715. bool(false)
  1716. -- Testing fgetcsv() with file opened using a+ mode --
  1717. array(1) {
  1718. [0]=>
  1719. string(6) "water-"
  1720. }
  1721. int(9)
  1722. bool(false)
  1723. array(3) {
  1724. [0]=>
  1725. string(5) "fruit"
  1726. [1]=>
  1727. string(3) "air"
  1728. [2]=>
  1729. string(0) ""
  1730. }
  1731. int(22)
  1732. bool(false)
  1733. -- Testing fgetcsv() with file opened using a+b mode --
  1734. array(1) {
  1735. [0]=>
  1736. string(6) "water-"
  1737. }
  1738. int(9)
  1739. bool(false)
  1740. array(3) {
  1741. [0]=>
  1742. string(5) "fruit"
  1743. [1]=>
  1744. string(3) "air"
  1745. [2]=>
  1746. string(0) ""
  1747. }
  1748. int(22)
  1749. bool(false)
  1750. -- Testing fgetcsv() with file opened using a+t mode --
  1751. array(1) {
  1752. [0]=>
  1753. string(6) "water-"
  1754. }
  1755. int(9)
  1756. bool(false)
  1757. array(3) {
  1758. [0]=>
  1759. string(5) "fruit"
  1760. [1]=>
  1761. string(3) "air"
  1762. [2]=>
  1763. string(0) ""
  1764. }
  1765. int(22)
  1766. bool(false)
  1767. -- Testing fgetcsv() with file opened using w+ mode --
  1768. array(1) {
  1769. [0]=>
  1770. string(6) "water-"
  1771. }
  1772. int(9)
  1773. bool(false)
  1774. array(3) {
  1775. [0]=>
  1776. string(5) "fruit"
  1777. [1]=>
  1778. string(3) "air"
  1779. [2]=>
  1780. string(0) ""
  1781. }
  1782. int(22)
  1783. bool(false)
  1784. -- Testing fgetcsv() with file opened using w+b mode --
  1785. array(1) {
  1786. [0]=>
  1787. string(6) "water-"
  1788. }
  1789. int(9)
  1790. bool(false)
  1791. array(3) {
  1792. [0]=>
  1793. string(5) "fruit"
  1794. [1]=>
  1795. string(3) "air"
  1796. [2]=>
  1797. string(0) ""
  1798. }
  1799. int(22)
  1800. bool(false)
  1801. -- Testing fgetcsv() with file opened using w+t mode --
  1802. array(1) {
  1803. [0]=>
  1804. string(6) "water-"
  1805. }
  1806. int(9)
  1807. bool(false)
  1808. array(3) {
  1809. [0]=>
  1810. string(5) "fruit"
  1811. [1]=>
  1812. string(3) "air"
  1813. [2]=>
  1814. string(0) ""
  1815. }
  1816. int(22)
  1817. bool(false)
  1818. -- Testing fgetcsv() with file opened using x+ mode --
  1819. array(1) {
  1820. [0]=>
  1821. string(6) "water-"
  1822. }
  1823. int(9)
  1824. bool(false)
  1825. array(3) {
  1826. [0]=>
  1827. string(5) "fruit"
  1828. [1]=>
  1829. string(3) "air"
  1830. [2]=>
  1831. string(0) ""
  1832. }
  1833. int(22)
  1834. bool(false)
  1835. -- Testing fgetcsv() with file opened using x+b mode --
  1836. array(1) {
  1837. [0]=>
  1838. string(6) "water-"
  1839. }
  1840. int(9)
  1841. bool(false)
  1842. array(3) {
  1843. [0]=>
  1844. string(5) "fruit"
  1845. [1]=>
  1846. string(3) "air"
  1847. [2]=>
  1848. string(0) ""
  1849. }
  1850. int(22)
  1851. bool(false)
  1852. -- Testing fgetcsv() with file opened using x+t mode --
  1853. array(1) {
  1854. [0]=>
  1855. string(6) "water-"
  1856. }
  1857. int(9)
  1858. bool(false)
  1859. array(3) {
  1860. [0]=>
  1861. string(5) "fruit"
  1862. [1]=>
  1863. string(3) "air"
  1864. [2]=>
  1865. string(0) ""
  1866. }
  1867. int(22)
  1868. bool(false)
  1869. -- Testing fgetcsv() with file opened using r mode --
  1870. array(6) {
  1871. [0]=>
  1872. string(4) """"""
  1873. [1]=>
  1874. string(1) """
  1875. [2]=>
  1876. string(1) ","
  1877. [3]=>
  1878. string(1) """
  1879. [4]=>
  1880. string(1) ","
  1881. [5]=>
  1882. string(4) ",,,,"
  1883. }
  1884. int(24)
  1885. bool(false)
  1886. array(1) {
  1887. [0]=>
  1888. string(39) "This is line of text without csv fields"
  1889. }
  1890. int(64)
  1891. bool(false)
  1892. -- Testing fgetcsv() with file opened using rb mode --
  1893. array(6) {
  1894. [0]=>
  1895. string(4) """"""
  1896. [1]=>
  1897. string(1) """
  1898. [2]=>
  1899. string(1) ","
  1900. [3]=>
  1901. string(1) """
  1902. [4]=>
  1903. string(1) ","
  1904. [5]=>
  1905. string(4) ",,,,"
  1906. }
  1907. int(24)
  1908. bool(false)
  1909. array(1) {
  1910. [0]=>
  1911. string(39) "This is line of text without csv fields"
  1912. }
  1913. int(64)
  1914. bool(false)
  1915. -- Testing fgetcsv() with file opened using rt mode --
  1916. array(6) {
  1917. [0]=>
  1918. string(4) """"""
  1919. [1]=>
  1920. string(1) """
  1921. [2]=>
  1922. string(1) ","
  1923. [3]=>
  1924. string(1) """
  1925. [4]=>
  1926. string(1) ","
  1927. [5]=>
  1928. string(4) ",,,,"
  1929. }
  1930. int(24)
  1931. bool(false)
  1932. array(1) {
  1933. [0]=>
  1934. string(39) "This is line of text without csv fields"
  1935. }
  1936. int(64)
  1937. bool(false)
  1938. -- Testing fgetcsv() with file opened using r+ mode --
  1939. array(6) {
  1940. [0]=>
  1941. string(4) """"""
  1942. [1]=>
  1943. string(1) """
  1944. [2]=>
  1945. string(1) ","
  1946. [3]=>
  1947. string(1) """
  1948. [4]=>
  1949. string(1) ","
  1950. [5]=>
  1951. string(4) ",,,,"
  1952. }
  1953. int(24)
  1954. bool(false)
  1955. array(1) {
  1956. [0]=>
  1957. string(39) "This is line of text without csv fields"
  1958. }
  1959. int(64)
  1960. bool(false)
  1961. -- Testing fgetcsv() with file opened using r+b mode --
  1962. array(6) {
  1963. [0]=>
  1964. string(4) """"""
  1965. [1]=>
  1966. string(1) """
  1967. [2]=>
  1968. string(1) ","
  1969. [3]=>
  1970. string(1) """
  1971. [4]=>
  1972. string(1) ","
  1973. [5]=>
  1974. string(4) ",,,,"
  1975. }
  1976. int(24)
  1977. bool(false)
  1978. array(1) {
  1979. [0]=>
  1980. string(39) "This is line of text without csv fields"
  1981. }
  1982. int(64)
  1983. bool(false)
  1984. -- Testing fgetcsv() with file opened using r+t mode --
  1985. array(6) {
  1986. [0]=>
  1987. string(4) """"""
  1988. [1]=>
  1989. string(1) """
  1990. [2]=>
  1991. string(1) ","
  1992. [3]=>
  1993. string(1) """
  1994. [4]=>
  1995. string(1) ","
  1996. [5]=>
  1997. string(4) ",,,,"
  1998. }
  1999. int(24)
  2000. bool(false)
  2001. array(1) {
  2002. [0]=>
  2003. string(39) "This is line of text without csv fields"
  2004. }
  2005. int(64)
  2006. bool(false)
  2007. -- Testing fgetcsv() with file opened using a+ mode --
  2008. array(6) {
  2009. [0]=>
  2010. string(4) """"""
  2011. [1]=>
  2012. string(1) """
  2013. [2]=>
  2014. string(1) ","
  2015. [3]=>
  2016. string(1) """
  2017. [4]=>
  2018. string(1) ","
  2019. [5]=>
  2020. string(4) ",,,,"
  2021. }
  2022. int(24)
  2023. bool(false)
  2024. array(1) {
  2025. [0]=>
  2026. string(39) "This is line of text without csv fields"
  2027. }
  2028. int(64)
  2029. bool(false)
  2030. -- Testing fgetcsv() with file opened using a+b mode --
  2031. array(6) {
  2032. [0]=>
  2033. string(4) """"""
  2034. [1]=>
  2035. string(1) """
  2036. [2]=>
  2037. string(1) ","
  2038. [3]=>
  2039. string(1) """
  2040. [4]=>
  2041. string(1) ","
  2042. [5]=>
  2043. string(4) ",,,,"
  2044. }
  2045. int(24)
  2046. bool(false)
  2047. array(1) {
  2048. [0]=>
  2049. string(39) "This is line of text without csv fields"
  2050. }
  2051. int(64)
  2052. bool(false)
  2053. -- Testing fgetcsv() with file opened using a+t mode --
  2054. array(6) {
  2055. [0]=>
  2056. string(4) """"""
  2057. [1]=>
  2058. string(1) """
  2059. [2]=>
  2060. string(1) ","
  2061. [3]=>
  2062. string(1) """
  2063. [4]=>
  2064. string(1) ","
  2065. [5]=>
  2066. string(4) ",,,,"
  2067. }
  2068. int(24)
  2069. bool(false)
  2070. array(1) {
  2071. [0]=>
  2072. string(39) "This is line of text without csv fields"
  2073. }
  2074. int(64)
  2075. bool(false)
  2076. -- Testing fgetcsv() with file opened using w+ mode --
  2077. array(6) {
  2078. [0]=>
  2079. string(4) """"""
  2080. [1]=>
  2081. string(1) """
  2082. [2]=>
  2083. string(1) ","
  2084. [3]=>
  2085. string(1) """
  2086. [4]=>
  2087. string(1) ","
  2088. [5]=>
  2089. string(4) ",,,,"
  2090. }
  2091. int(24)
  2092. bool(false)
  2093. array(1) {
  2094. [0]=>
  2095. string(39) "This is line of text without csv fields"
  2096. }
  2097. int(64)
  2098. bool(false)
  2099. -- Testing fgetcsv() with file opened using w+b mode --
  2100. array(6) {
  2101. [0]=>
  2102. string(4) """"""
  2103. [1]=>
  2104. string(1) """
  2105. [2]=>
  2106. string(1) ","
  2107. [3]=>
  2108. string(1) """
  2109. [4]=>
  2110. string(1) ","
  2111. [5]=>
  2112. string(4) ",,,,"
  2113. }
  2114. int(24)
  2115. bool(false)
  2116. array(1) {
  2117. [0]=>
  2118. string(39) "This is line of text without csv fields"
  2119. }
  2120. int(64)
  2121. bool(false)
  2122. -- Testing fgetcsv() with file opened using w+t mode --
  2123. array(6) {
  2124. [0]=>
  2125. string(4) """"""
  2126. [1]=>
  2127. string(1) """
  2128. [2]=>
  2129. string(1) ","
  2130. [3]=>
  2131. string(1) """
  2132. [4]=>
  2133. string(1) ","
  2134. [5]=>
  2135. string(4) ",,,,"
  2136. }
  2137. int(24)
  2138. bool(false)
  2139. array(1) {
  2140. [0]=>
  2141. string(39) "This is line of text without csv fields"
  2142. }
  2143. int(64)
  2144. bool(false)
  2145. -- Testing fgetcsv() with file opened using x+ mode --
  2146. array(6) {
  2147. [0]=>
  2148. string(4) """"""
  2149. [1]=>
  2150. string(1) """
  2151. [2]=>
  2152. string(1) ","
  2153. [3]=>
  2154. string(1) """
  2155. [4]=>
  2156. string(1) ","
  2157. [5]=>
  2158. string(4) ",,,,"
  2159. }
  2160. int(24)
  2161. bool(false)
  2162. array(1) {
  2163. [0]=>
  2164. string(39) "This is line of text without csv fields"
  2165. }
  2166. int(64)
  2167. bool(false)
  2168. -- Testing fgetcsv() with file opened using x+b mode --
  2169. array(6) {
  2170. [0]=>
  2171. string(4) """"""
  2172. [1]=>
  2173. string(1) """
  2174. [2]=>
  2175. string(1) ","
  2176. [3]=>
  2177. string(1) """
  2178. [4]=>
  2179. string(1) ","
  2180. [5]=>
  2181. string(4) ",,,,"
  2182. }
  2183. int(24)
  2184. bool(false)
  2185. array(1) {
  2186. [0]=>
  2187. string(39) "This is line of text without csv fields"
  2188. }
  2189. int(64)
  2190. bool(false)
  2191. -- Testing fgetcsv() with file opened using x+t mode --
  2192. array(6) {
  2193. [0]=>
  2194. string(4) """"""
  2195. [1]=>
  2196. string(1) """
  2197. [2]=>
  2198. string(1) ","
  2199. [3]=>
  2200. string(1) """
  2201. [4]=>
  2202. string(1) ","
  2203. [5]=>
  2204. string(4) ",,,,"
  2205. }
  2206. int(24)
  2207. bool(false)
  2208. array(1) {
  2209. [0]=>
  2210. string(39) "This is line of text without csv fields"
  2211. }
  2212. int(64)
  2213. bool(false)
  2214. Done