PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Muhammad Umer Farooq   PHP Language Selector class   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Language Selector class
Get texts for the current language from globals
Author: By
Last change: Apply fixes from StyleCI
Date: 5 years ago
Size: 1,156 bytes


Class file image Download

require_once 'core/init.php';

if (isset(
$_POST['lang'])) {
$lang = new Language();

<!DOCTYPE html>
<html lang="en">
  <title><?= printl('home'); ?></title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="">
  <script src=""></script>
  <script src=""></script>

<div class="container">
  <form action='' method="post" >
    <div class="form-group">
      <label for="language"><?= printl('select'); ?>:</label>
      <select class="form-control" id="language" name='language' >
        <option value='en'><?= printl('en'); ?></option>
        <option value='ur'><?= printl('ur'); ?></option>
    <div class="form-group" >
        <input type="submit" name="lang" class='btn btn-primary' value='<?= printl('submit'); ?>' />