1
Guys I’m putting together a system where I want to do it mutipla language... Well created the project, inside it has a folder strings (where inside has a file called EN-BR.php), has a file functions (where has a function that passes the file name and includes with include_once), in the file I’m doing the test while including and calling function it all normal, but when I echo a var that is inside the file, error. How can I solve ? or is there an easier way ? Thank you
php test file.
<?php
include_once ("class/funcoes.php");
autoLoad();
session_start();
$sl = $_SESSION['lang']; //Passa PT-BR
defineLanguage($sl);
echo $strNome;
class/funcoes.php file
<?php
function defineLanguage ($language) {
$dir = "strings/";
if($language == "PT-BR") {
$include = $dir . "PT-BR" . ".php";
//include_once($include);
include('strings/PT-BR.php');
}
}
string file/EN.php
<?php
$strNome = "teste";
ERROR
Notice: Undefined variable: strNome in /Applications/XAMPP/xamppfiles/htdocs/log-u/testeSession.php on line 11
You can resolve this by posting the code and error message.
– rray
@rray I put the code...
– Augusto Furlan