denoteone Posted January 28, 2009 Share Posted January 28, 2009 How do I create an array and fill it with variables? $sitebreakdown=array($_POST['micro'],$_POST['medium'],$_POST['large']); I then am going to save $sitebreakdown in a session variable like $_SESSION['site_breakdown'] = $sitebreakdown; am I on the right track? Link to comment https://forums.phpfreaks.com/topic/142809-filling-an-array-with-post-variables/ Share on other sites More sharing options...
gevans Posted January 28, 2009 Share Posted January 28, 2009 Sounds fine, try it. You might want to check that the POST data is what you expect though Link to comment https://forums.phpfreaks.com/topic/142809-filling-an-array-with-post-variables/#findComment-748538 Share on other sites More sharing options...
trq Posted January 28, 2009 Share Posted January 28, 2009 Why not just copy the $_POST array into your $_SESSION array? $_SESSION['post'] = $_POST; Link to comment https://forums.phpfreaks.com/topic/142809-filling-an-array-with-post-variables/#findComment-748540 Share on other sites More sharing options...
denoteone Posted January 28, 2009 Author Share Posted January 28, 2009 I have about 20 variable coming through the post I don't want to save them all in the array. But now that I know you can do that I will keep it in mind. I will echo my array and see what I get. Link to comment https://forums.phpfreaks.com/topic/142809-filling-an-array-with-post-variables/#findComment-748546 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.