Trying to convert $_GET to $_SESSION but alot of them using php for loop!
But i cant get it to work!
for ($x = 0; $x <= 2; $x++) {
$_SESSION["u'.$x.'_first_name"] = $_GET["u'.$x.'_first_name"];
}
Trying to convert $_GET to $_SESSION but alot of them using php for loop!
But i cant get it to work!
for ($x = 0; $x <= 2; $x++) {
$_SESSION["u'.$x.'_first_name"] = $_GET["u'.$x.'_first_name"];
}
2
Answers
Everyone was right. It works already, maybe i have some intefering $x somewhere else that was making the code not to work. As when i run it by it self, its all good!
https://ideone.com/sodDBm (a fiddle for it)
Thanks everyone for your help!
I think this what you want
Your single quotes were bracketing the $x.
And I have started the loop counter at 1 (from the comments).