Palavra mais longa

<?php 

function LongestWord($sen) {

  $words = explode(" ", $sen);
  $longestWord = "";
  for($i = 0; $i < count($words); $i++){
    if(strlen($longestWord) < strlen($words[$i]) && !preg_match("/[\W]/", $words[$i])){
      $longestWord = $words[$i];
    }
  }
  return $longestWord;

}
jo3e