[PHP] Reading Text from file

Hi, I really don’t know how to go about this problem: :ne:

I have a .txt file formatted like this:

Fruit
Apple pear orange etc…

Vegitable
Carrot Pea etc…

(the space indicates set of details)

How would I go about it, so when the user selects “Fruit” the PHP file looks for the word Fruit, and takes the next line and puts it into the veriable $a or somthing.

I think it would use some kind of, Foreach(); command but I don’t know how it would only take out the next line and put that into a variable.

thanks for all your help :slight_smile: