Filter text file with another text file using php : I have got two text files and i need to filter file1 with file2 and put the results in file3.

file1:

1232131-72-427-Q john johnson -----more data----------more data-----<br>
8765438-43-542-T peter dudeson -----more data----- -----more data-----<br>
3456761-21-742-G frank zena -----more data----------more data-----<br>
0924560-23-124-O marin franklin -----more data----------more data-----<br>
2345333-21-423-P pin dudeson-----more data----------more data-----<br>
5434225-21-983-A chow ching -----more data----------more data-----

file2:<br>      
8765438-43-542-T<br>
0924560-23-124-O<br>
5434225-21-983-A

outputfile:<br>
8765438-43-542-T peter dudeson-----more data----------more data-----  <br>
0924560-23-124-O marin franklin-----more data----------more data----- <br>
5434225-21-983-A chow ching-----more data----------more data----- 

so basically it has to check the numbers+oneletter and delete all the lines that do not match and keep the full lines that do match. I hope someone helps me with this because im stuck on it for way too long now. 