little syntax error - need help please

Hi there,
I don’t understand what am I missing.
With this code I get a title, a language name and an icon flag
[php]if ($languages && $user[‘languages’]!=’’)
echo ‘;
foreach ($languages_array as $lang)
echo ’ ‘.$lang[‘name’].’’;

Why can I get just the icon flag with this one (different page)

[php] if ($user[‘languages’])
echo ‘’;

Any help will be very appreciate.

Because $lang is specified in the foreach loop and therefor doesn’t exist in your second code.

I tried to add a foreach in my second code but doesn’t work :-[
Then I tryed to remove the if condition but doesn’t work either :-[
I’m going craisy with this code :’(
Can you please be more specific, please?

Can’t you just copy the first code and remove what you don’t need?

if ($languages && $user[‘languages’]!=’’) {
foreach ($languages_array as $lang) {
echo ‘’;

Hi M@tt,
I really appreciate your help but, that doesn’t work.
It looks easy but at the end :-[
May I send you the 2 php files? I don’t want abuse of your kindness!

You’re missing a quote

[php]echo ';[/php]

should be…
[php]echo ‘’;[/php]

Hi mdahlke,
Thank you soo much. Now it’s working :smiley:
I really appreciate your help.

Sponsor our Newsletter | Privacy Policy | Terms of Service