I have this php code and i can not make my search results to show me first the listings with the most number of keywords i have type. How can do that?
$search_array = array_unique(explode(' ', $search));
foreach ($search_array as $k => $v)
{
$w = trim($v);
if ($w)
{
$result[$i]['title'] = preg_replace('/(' . preg_quote($w, '/') . ')/siU', '<b>\\1</b>', $result[$i]['title']);
$result[$i]['description'] = preg_replace('/(' . preg_quote($w, '/') . ')/siU', '<b>\\1</b>', $result[$i]['description']);
}
}