Jump to content

variable language


regoch

Recommended Posts

I got site wirch I like tu turn to multilanguage.

<?=$home_jezik?>

This is my variable for language code. So I wonna add it to

<?php echo $redak['novost_naslov_hr']; ?>

so that  "hr" change to "en" or any other language. I try with this but nothing happens

<?php echo $redak['novost_naslov_.$home_jezik']; ?>

Link to comment
Share on other sites

Pikachu2000 beat me to it, but I've provided some add'l info, so I'll post anyway.

 

You have two problems in what you are doing. 1) Variables are not parsed inside single quoted strings and 2) You cannot concatenate strings inside the quotes like that. You would need to use double quotes (without the concatenate character - period) or append the string outside the quotes using either single or double quotes.

 

echo $redak["novost_naslov_$home_jezik"];

 

Or

 

echo $redak['novost_naslov_' . $home_jezik];

Link to comment
Share on other sites

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.