Jump to content

Recommended Posts

Hey, I`v a problem. I`m using include function.

 

include 'lang.php';

 

now I want to use all of the variables that exist in lang.php ..

the problem is that I`m using functions on my index.php file, and I don't want to enter the function every time with those variables.

 

how can I fix it?

 

 

10x.

Make the variables in the lang.php constants.

 

IE:

 

//lang.php

<?php
// insetad of
$my_welcome_text = "Welcome Home!";

//use
define('MY_WELCOME_TEXT', 'Welcome Home!');
?>

 

That way it is available to every function, class etc as long as it is included.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.