Hi, I need some help with reading a txt file line by line using PHP so I can then add parts of each line to MYSQL database. I have a txt file that looks like this: Beyonce - Halo (2:45) Metallica - The Day That Never Comes (5:45) I need to read the artist name, then the song name and then the length and be able to add it to a database. Anyone know how to retrieve a bit of a line at a time? Cheers
Use the file() function which will put each line into an array. You can then use a regular expression or a strpos() -> substr() to extract the data you need.