here is my dilemma :
I am creating a multilingual platform. In that purpose I created json files containing all the translated text for each language.
Now when the user land on a their page I read from that file and store the array of translations in the $_SESSION variable such as
$_SESSION['website_text'] = json_decode(file_get_contents("content_".$language.".json"), true);
Then everytime I want to echo text on the views I access the element from the session array :
$text = $_SESSION['website_text']['paragraph2_headline'];
Now I am wondering, since the $_SESSION is stored on the server. Is it faster to read from the session like I do or to read everytime from the file and decode the json? The second option would go like that :
$website_text = json_decode(file_get_contents("content_".$language.".json"), true);
$text = $website['paragraph2_headline'];
Thank you all for your help!