I'm writing a simple "httpref" program that captures search engine responses into a large text file. For example, the log file contains a lot of data, and every so often there is a ?q= where it terminates with an &:
What I'd like to do is create an array using explode where it filters out everything except for the desired result: i.e. "blogging+for+answers". The text file contains a lot of junk and I only want to keep the results between each ?q= and & symbols.
From what I've seen there isn't a simple parser that extracts parameter data from a URL string.
i.e. $q[0] = "blogging+for+answers"
Every time I use explode with just ?q= it takes the entire text up until the next occurrence of ?q=, I only want it up until the &
parse_stravailable in PHP!