i have a file with a lot of lines... all of this lines are in this format...
name surname dd/mm/yy otherinfo otherinfo
name surname dd/mm/yy otherinfo otherinfo
name surname dd/mm/yy otherinfo otherinfo
name surname dd/mm/yy otherinfo otherinfo
what i want to do is read the file, and manipulate line by line inserting into array, when it finds the \n will look for the next line...
i have check explode function, but i just see obtions to explode when it finds something between strings and in this case i don't have nothing...
how can i do this ??
read from file and separate strings
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
I'm not very good at regex so I don't know how to physically break up your string, but what I can tell you is if you open your file with file() then each line will be put into an array element already.
that dont result for me...
what that will do is the first array[0] will have all until e find \n what i want is that explode check multiple combinations to result in:
array[0] = 1 string explode with" "
array[0] = 2 string explode with"/"
array[0] = 2 string explode with":"
i think i will need to check 1 by 1..
what that will do is the first array[0] will have all until e find \n what i want is that explode check multiple combinations to result in:
array[0] = 1 string explode with" "
array[0] = 2 string explode with"/"
array[0] = 2 string explode with":"
i think i will need to check 1 by 1..