Php variables end up NULL (but the code works)!

请求翻译

I use the following code to change the language in my website:

?>

I want to add a Javascript file according to the value of one of the variables, in this case $lang_file:

    
    
    
    

But it doesn't work because all the variables become NULL at the end (but the code works).

I tested it with this and it says NULL NULL NULL NULL:

var_dump($translation);
var_dump($lang);
var_dump($string);
var_dump($lang_file);

Any suggestions?

EDIT: sample of the Javascripts I'm calling (val-xx.js):

$(document).ready(function(){
    $("#sendmail").validate({
        rules: {
            FieldData0: {
                required: true
            },
            FieldData1: {
                required: true,
                email: true
            },
            FieldData2: {
                required: true
            }
        },
        messages: {
            FieldData0: {
                required: "Please enter your name"
            },
            FieldData1: {
                required: "Please enter your email address"
            },
            FieldData2: {
                required: "Please enter a message"
            }
        }
    });
})

a sample of a lang.$lang.php file:

 '我创造简单...',

(and so on)

5个回答