code: public function hasEmail($string)
      {
          $result = false;
          $tokenizer = new General();
          $words = $tokenizer->tokenize($string);
  
          foreach ($words as $word) {
              if (filter_var($word, FILTER_VALIDATE_EMAIL)) {
                  $result = true;
              }
          }
  
          return $result;
      }
docs: Check if string has email.
  
  @param string $string
  
  @return bool