It depends on:
a) What the results are
b) How many results you expect, on average?
c) Do you need the results after the script is done executing? For other pages?
If the results are very large strings, documents, or binary files (like images) then you may consider a temp table.
If you expect thousands of results, even if they are small text strings (like file names) then you may consider a temp table.
If you need to have access to the result list from other scripts after the search script is done executing, then a temp table is a good idea.
Keep in mind that DBMS's are typically for persistent data. For this reason, the DBMS will commit your table and each one of it's changes to disk as soon as it can. You may not have control over when this happens. If you have to read data from the disk later in the script, it is much slower than reading from memory (RAM).
I would say if your needs don't really fall into one of the categories listed above, an array or other memory structure should suffice.