Ciao,
devo impostare un sito multilingue. L'idea è quella di caricare file diversi in base alla lingua richiesta:
italian.php
Codice PHP:
$text = array();
$text[0] = 'ciao';
$text[1] = 'buongiorno';
english.php
Codice PHP:
$text = array();
$text[0] = 'hello';
$text[1] = 'good morning';
La domanda è: per richiamare il $text all'interno delle funzioni è una buona idea usare il global??
Codice PHP:
function prova()
{
global $text;
echo $text[0];
}
oppure
Codice PHP:
function prova($text)
{
echo $text[0];
}
oppure altro???