code: public static function simpleDetect($text)
      {
          $detections = self::detect($text);
  
          if (count($detections) > 0)
              return $detections[0]->language;
          else
              return null;
      }
docs: Simple detection. If you need just the language code.
  
  @static
  @param string @text The text for language detection
  @return string detected language code