PHP code example of pixelairport / locale
1. Go to this page and download the library: Download pixelairport/locale library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pixelairport / locale example snippets
// Load pixelairport/locale to your file
use Pixelairport\Locale\Currency;
use Pixelairport\Locale\Country;
use Pixelairport\Locale\Language;
use Pixelairport\Locale\Locale;
// Sample class
class Product {
public function getSingleLanguage(){
return Language::get('en','de'); // Returns the german name for english. In this example "Englisch".
}
public function languages(){
return Language::all('de'); // Returns an array with all languages in german
}
}