[eluser]Fielder[/eluser]
Code:
<?php
$q = strtolower($_GET['q']);
if (!$q) return;
$items = array(
"Green Heron"=>"Butorides virescens",
"Solitary Sandpiper"=>"Tringa solitaria",
"Heuglin's Gull"=>"Larus heuglini"
);
foreach ($items as $key=>$value) {
if (strpos(strtolower($key), $q) !== false) {
echo "$key|$value\n";
}
}
?>
which is in search.php. Search.php is called by my jQuery Autocomplete. When the user begins typing in a text field, it runs the search.php file to display the matching text. I know strpos finds the first occurrence of the string, but the "$key|$value\n" ?? In action, it's only echoing the $key information.