php - explode is not working to split string -


We are unable to split the string to the following code. help please.

  & lt;? Php $ i = 0; $ MyFile = "testFile.txt"; $ FH = FOPAN ($ myfile, 'a') or die ("can not open file"); $ StringData = "no \ t"; FILIT ($ FH, $ string data); $ StringData = "user name \ t"; FILIT ($ FH, $ string data); $ StringData = "password \ t"; FILIT ($ FH, $ string data); $ Newline = "\ r \ n"; Fillit ($ FH, $ Newline); $ StringData1 = "1 \ t"; FILIT ($ FH, $ string data 1); $ StringData1 = "Srinivas \ t"; FILIT ($ FH, $ string data 1); $ String data1 = "mallupapa \ t"; FILIT ($ FH, $ string data 1); Fclose ($ fh); ? & Gt; $ FH = FOPAN ("testFile.txt", "R"); $ While (FIF ($ FH)) {$ line = fgets ($ fh); Echo $ line; } Fclose ($ FH); $ Beatles = array ('pmm', 'malappe', 'Srinivas', 'php'); For ($ i = 0; $ i & lt; Count ($ Beattles); $ i ++) {If ($ i == 2) {echo $ Beatles [$ I-1]; Eco $ Beatles [$ i-2]; }} $ Pass_ar = array (); $ FH = FOPAN ("testFile.txt", "R"); While (! FIF ($ FH)) {$ line = fgets ($ fh); Echo $ line; $ T1 = explosion ("", $ line); Print_r ($ t1); Array_push ($ pass_ar, t1); } Fclose ($ FH);  

If I read the code properly then you're typing a different string than \ t But try to explode with spaces, use:

  explosion ("\ t", $ string);  

Comments