title: PHP/MySQL: Highlight "SOUNDS LIKE" query results
body: <p>Quick MYSQL/PHP question. I'm using a "not-so-strict" search query as a fallback if no results are found with a normal search query, to the tune of:</p>
  
  <pre><code>foreach($find_array as $word) { 
    clauses[] = "(firstname SOUNDS LIKE '$word%' OR lastname SOUNDS LIKE '$word%')";
  }
  if (!empty($clauses)) $filter='('.implode(' AND ', $clauses).')';
  $query = "SELECT * FROM table WHERE $filter";
  </code></pre>
  
  <p>Now, I'm using PHP to highlight the results, like:</p>
  
  <pre><code>foreach ($find_array as $term_to_highlight){
      foreach ($result as $key =&gt; $result_string){
          $result[$key]=highlight_stuff($result_string, $term_to_highlight);
      }
  }
  </code></pre>
  
  <p>But this method falls on its ass when I don't know what to highlight. Is there any way to find out what the "sound-alike" match is when running that mysql query?</p>
  
  <p>That is to say, if someone searches for "Joan" I want it to highlight "John" instead.</p>