PHP code example of o80 / i18n
1. Go to this page and download the library: Download o80/i18n 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/ */
o80 / i18n example snippets
$i18n = I18N::instance();
$i18n->setPath(__DIR__ . '/langs');
$i18n->setDefaultLang('en');
$i18n = new I18N();
$i18n->setPath(__DIR__ . '/langs');
$i18n->setDefaultLang('en');
<h1> echo __('Generic', 'Welcome');
<h1> echo $i18n->get('Generic', 'Welcome');