I am creating a category list.. 20 different categories and when they click and send a category it will pass a numeric value representing the category to the Database..
For example:
<option value="1">Apple</option>
<option value="2">Microsoft</option>
The reason for that I am passing a numeric value in the database, is because I have more than 1 language on the webpage, and I have different label files. I would like to echo a php variable based on the category number.
<? echo $ct_1; ?>
But to avoid a lot of if/else statements, I would like to know if I could add the number to the variable. So if I am looping the category to be this: $row['category'] I would like to add that variable to the other one.. Like so:
<? $category = $.'ct_'.$row['category']; echo $category; ?>
I know that is not possible.. But I hope you get my idea and maybe have a solution for this.
This is called variable variables.
Or just: