Hello there, i will show you how to so a simple language file in php.
First lets make our lang file
So this is our language file. You can name it anything but i recommend what language it is (e.g english french ect)
So our language file is ready now this is how we will call our text
Our final product should look like this.
Thats all there is to it tt1:
First lets make our lang file
PHP:
<?php
// Simple lang file
// So easy a caveman can do it!
$lang['page_text'] = "lulz hai thar";
?>
So this is our language file. You can name it anything but i recommend what language it is (e.g english french ect)
So our language file is ready now this is how we will call our text
PHP:
<?php echo $lang['your_text']; ?>
Our final product should look like this.
PHP:
<?php
require_once('lang_file_name.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<html>
<head>
<title>Language File Tutorial By Joint</title>
</head>
<body>
<p><?php echo $lang['page_text']; ?></p>
</html>
</body>
Thats all there is to it tt1:
Last edited: