In the PHP sessions I have a variable called "firstname1" saved,
Im using as loop as such:
Code: Select all
$numberofpeople = 2; (this is actually in the session header also)
$current = 0;
while ($current < $numberofpeople) {
++$current;
echo "Person Number $current<P>
echo "$firstnameї$current]";
";
}Now, I know this line wont work: echo "$firstname[$current]";
This above code will print:
"Person Number 1
1
Person Number 2
2"
As you can see it ignores "$firstname" because the variable alone does not exist, but "$firstname1" and "$firstname2" do.
How do I combine "firstname" and "$current "to give me a usable variable to pull in the info from the session?
Code: Select all
Code: Select all