Language Detection Class using Google Translation API

  • Language: PHP
  • Released: Feb 23, 2011
    Last Update: Feb 23, 2011


This class can help you to detect the language of a given text. Uses the Google Translation API.


require 'lang_detect.class.php';  
$text = 'It is text in English';  

try {  
  echo lang_detect::detect($text);  
} catch (LangDetectException $e) {  
  echo $e->getMessage();  
You need to log-in or create an account
  • Create an account
  • Log-in
Please use your real name.
Activation link will be sent to this address.
Minimum 8 characters
Enter your password again

Clicking this button confirms you read and agreed to the terms of use and privacy policy.


Save your watchlist

Fill your details below to receive project updates from your watch list - including new versions, price changes and discounts.

I agree to the terms of use and privacy policy.

or Get a quote

for customization or integration services

Post a comment

Or enter your name and Email
No comments have been posted yet.