Jump to content

search string for partial match


glenelkins

Recommended Posts

how can i test a sting for a partial match? i tried the following but it does not work:

[code]
// Example
$search_for = "Helen"  // full text could be Helen Lee Scott

$profileCount = 0;
while ($profileArray = mysql_fetch_array($result)) {
  // Check the bride first
  if (strpos($profileArray['bride'],$search_for) > 0) {
    // Found part of the name
    $found_profileArray[$profileCount] = $profileArray['bride'];
  }
  $profileCount++;
}

if (!empty($profileArray)) {
  ACTIONS
} else {
  ACTIONS
}
[/code]
Link to comment
https://forums.phpfreaks.com/topic/11957-search-string-for-partial-match/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.