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 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? 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 Link to comment https://forums.phpfreaks.com/topic/7958-dynamically-create-variables/#findComment-29018 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.