How do I keep a count of undefined strings within a loop using PHP?

Posted by mike on Stack Overflow See other posts from Stack Overflow or by mike
Published on 2010-05-11T18:21:17Z Indexed on 2010/05/11 18:24 UTC
Read the original article Hit count: 212

Filed under:
|
|
|

I'm using a loop within a loop to try to generate keyword combinations and also find the ones that have been used the most.

My outside loop just queries a list of keywords (lets use "chicago" as our first keyword, 3 records were found).

The inside loop finds all the records in the "posts" table where keyword = "chicago".

Within this loop, I need to generate strings based on info I found in the database. Which, would look something like "chicago bulls", "chicago bears", "chicago cubs" etc... I know how to do everything up until this point, but how do I temporary hold these generated strings and count how many times they have been found within the 3 records?

© Stack Overflow or respective owner

Related posts about php

Related posts about strings