Actually, $TitleString is an array, because I originally designed it as a string, but it turned into an array...
I GOT IT WORKING!!!!!!!!!!!!!!!!!!!!!!!!!
THANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTH ANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHAN KYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOUTHANKYOU
Thank you!!!!!!!




Here's the code:
PHP Code:
$titles = array("title 1", "2", "3");
$search = $sq; // you would get this from a $_POST-, $_GET-variable or similar
$results = array();
foreach ($titles as $title) {
if (stristr($title, $search)) {
$results[] = $title;
}
}
echo "<b>$results[0]</b>";
I took out the var dump thing because it just said 'NULL'. It works like this, so thank you!
Now I've gotta get it to display ALL the results, not just the first one... I'm using stristr, which is a find first occurrence in string case insensitive, so I'll find one that finds all occurrences in string, case insensitive... I'll report back soon!
For example, though, would be:
ARRAY CONTENTS: Crap Content, Good Content
SEARCH: content
OUTPUT: Crap Content
OVER-THE-TOP USER: "But I want the good content!! This site sucks, the search only displays one thing, and it's crap!"

It outputs whatever's first in the array. I need it to output all of them.
There's a function called str_replace that replaces every match with something, but I simply need it to
find them all...