Concatenate variables

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have 3 inc. files where I keep names of series in different
languages. For example:
$series_1 = 'kdfkd';
$series_2 = 'fdgdgd';
$series_3 = 'hdssasd';

In my database I count how many different series there are (In the
database I have different elements that belong to series). I want to
make a link  for every serie. So I use a for loop:
for ($i = 1; $i <= $total_series; $i++) {
     <a href="paintings.php?lang=<? echo $lang?>&code_series=<? echo $i
?>" target="_blank"><? echo $series_.$i ?></a> -> this last part is the
How can I write the reference to the serie name in the inc. file.
That's to say, how can I concatenate $series_ and the value of $i????

Thanks. Bettina

Re: Concatenate variables wrote:
Quoted text here. Click to load it

You mean like this:

$series_1 = 'kdfkd';
$series_2 = 'fdgdgd';
$series_3 = 'hdssasd';

$i = 2;

echo $; // echo 'fdgdgd'

Re: Concatenate variables

GENIAL! Thank you!!!!

Site Timeline