fgetcsv_variation6.phpt 34 KB

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