Hello, I am trying to add artificial intelligence (Google's Did You Mean) in my php/ mysql search. For this purpose I am using following code <?PHP $search = $_POST['search']; $result = mysql_query("Select * From dictionary Where 1 = '1'"); if(mysql_num_rows($result)) { While ($row = mysql_fetch_object($result)) { similar_text(strtoupper($search), strtoupper($row->words), $similarity_pst); if(number_format($similarity_pst, 0) > 70) { echo $row->words; } } } ?> PHP: The code works very fine. But I am trying to use Max() function instead of > 70 to get only one entry of which value is highest. for this my code looks something like this similar_text(strtoupper($search), strtoupper($row->words), $similarity_pst); $percent = $similarity_pst; if (Max($percent)) { echo $row->words; } PHP: But this doesn't work. Any help please? Thanks