PHP Language Class

PHP Language Class

Version 3.1

PHP language class was developed thinking on developers and users. It helps you integrate and configure multiple languages by creating language files using an associative array. Users are able to choose their preferred languages but first the script automatically detects the browser language and use the appropriate language file based on the users default browser language and in case you don’t have created that language the script will use the website default language configured on the script. PHP files can be configured using super global GET or POST to convert the website to the particular language. It’s easy to modify and create language files. Documentation and demos available!


  • User browser language will be default
  • You configure the translations (from native to translated language)
  • Multiply language support
  • Translate images (Don’t need to create two websites because of the images)


April 2012 (Version 3.1)

  • Updated Documentation – Supported Languages Codes
  • Updated Class (Now Supports Worldwide Languages)
  • Updated Demo

November 2011 (Version 3.0)

  • Rewritten the class
  • Fixed bugs that limited and prevented the use of functions and OOP for the translations.
  • Improved Documentation, added more examples on how to use on functions and classes creating the possibility for large projects

August 2011 (Version 2.0)

  • Fixed an issue with the preferred default language due to sessions and changed the languages file extension to “.lang”;

Code Example:

          $var = new Language;
          $var2 = $var->getLanguage($params);

          // to call
          echo $var2['translatedKey'];

          // to use on functions
          function translate_title()
        global $var2;

        return $var2['title'];    
          echo translate_title();

and more...