mister_t101 Posted April 20, 2006 Share Posted April 20, 2006 Is there a way to dynamically create variables by traversing an array, then naming the variable with the position in the array?for example....for ($i=0; $i<count($_SESSION['order']); $i++){create variable named $posei;$posei=$i;}Thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/7958-dynamically-create-variables/ Share on other sites More sharing options...
ober Posted April 20, 2006 Share Posted April 20, 2006 Why not use a second array? Quote Link to comment https://forums.phpfreaks.com/topic/7958-dynamically-create-variables/#findComment-29015 Share on other sites More sharing options...
kenrbnsn Posted April 20, 2006 Share Posted April 20, 2006 Yes. Look at [a href=\"http://www.php.net/manual/en/language.variables.variable.php\" target=\"_blank\"]variable variables[/a].Ken Quote Link to comment https://forums.phpfreaks.com/topic/7958-dynamically-create-variables/#findComment-29018 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.