I am having trouble trying to append a number to the end of a PHP variable. The problem is because the number I am trying to append is stored in a Javascript variable. Here is my code:
fields.eq(n).attr('value', "<?php echo $_SESSION['fname_" + countItem + "'] ; ?>");
This is not working. I need the number stored in the Javascript variable countItem
to append to the end of the $_SESSION
variable. The final $_SESSION
variable should look like this: $_SESSION['fname_1']
. Is there a way of doing this? Thanks