hey say I have a file containing something like this
name1 lastname1 email1 date1
name2 lastname2 email2 date2
name3 lastname3 email3 date3
what would the most efficient way to go through it to retrieve the first name last name email and date be? Would just exploding on a new line and then exploding those results on a space be sufficient?
Your data is effectively a CSV file, using a space character as a delimiter. You can use
fgetcsvand set the delimiter option:It would probably be a better idea to use a different character for delimiting, such as a comma, a tab, or a pipe
|.