I have searched for almost 30 minutes and still can't find the answer for my problem. So, here is it: I have an JSON-file called "localeDE.l", now I'm trying to print the objects to the website, "locale_name"(type: string) works, but "translations"(type: array) won't work.
My JSON file:
"locale_name": "DE",
"translations": [
{"Welcome": "Willkommen",
"Goodbye": "Auf Wiedersehen"}
]
Here my PHP file:
$file = file_get_contents('localeDE.l');
$locale = json_decode($file);
print_r($locale);
echo "Locale=" . $locale->{'locale_name'};
echo "Translations:";
echo " Welcome:" . $locale->{'translations'}->{'Welcome'};
echo " Goodbye:" . $locale->{'translations'}->{'Goodbye'};
I also tried something like (...) $locale->{'translations.Welcome'}; etc.
Can You help me?
- Felipe Kaiser
$local['translations']['Welcome']mixedat php.net^^ Thank You!var_dump($locale), then. look at what got produced.