Finding line of keyword in a text file

Hello! I am building a description system that will be implemented into a gallery script. The script will get the name of the image, find that name in a text file, and read all the text on the same line of the name of the image.

I already have a script that reads lines from text files but now I need some help with the finding the line part. I need it to find the keyword and tell me the line it’s on. I know strpos() can find the keyword for me but that tells me the amount of characters between the beginning of the file and the position of the keyword. So if anyone has any suggestions or example scripts that’d be awesome.

Thanks for the help!:sen: