Here is part of the code.
$DatabaseArray=Array("Cooking","look","I cant","Walking the dog to the park","washing&q
$lengths = array_map('strlen', $DatabaseArray); $maxLength = max($lengths); $index = array_search($maxLength, $lengths); echo $DatabaseArray[$index];