Using PHP, is there a better way of extracting the appropiate bits of information out of a text file without using strpos and substr PHP functions?
I need to extract the "Course xxx", No, and Ref
Example: The results for record with Subject of "Course 1...." would be:
- Course 1
- 8415
- 152
Example .txt File:
Name: Dave
Age: 15
Subject: Course 1 (No: 8415, Ref: #152#)
Description:
Description 1
Name: John
Age: 28
Subject: Course 2 (No: 646544, Ref: #325#)
Description:
Description 1
Name: Steve
Age: 22
Subject: Course 3 (No: 545, Ref: #451#)
Description:
Description 1
EDIT: Noticed I don't need all data extracted, but all data will still be in file.