We Must Design Posted October 10, 2007 Share Posted October 10, 2007 I was wondering how to add a query string to an array. I have managed to get this working with the following code but I have had problems working with the array: $_SESSION['favoriteArray'][] = $_GET['cocktail']; I am wanting to put the variables into a standard array: $myArray = array(); How would I insert a query string into this type of array? Quote Link to comment https://forums.phpfreaks.com/topic/72649-array-question/ Share on other sites More sharing options...
trq Posted October 10, 2007 Share Posted October 10, 2007 You need to be alot more descriptive. What exactly do you want to store in an array? Quote Link to comment https://forums.phpfreaks.com/topic/72649-array-question/#findComment-366288 Share on other sites More sharing options...
We Must Design Posted October 10, 2007 Author Share Posted October 10, 2007 I am creating a recipe website and a user can add a recipe to their favorites. When a user clicks on add to favorites the vaiable will be passed via a query string: add_recipe=test_recipe I am wanting to add the variable add_recipe to an array Quote Link to comment https://forums.phpfreaks.com/topic/72649-array-question/#findComment-366290 Share on other sites More sharing options...
trq Posted October 10, 2007 Share Posted October 10, 2007 <?php $myarr[] = $_GET['add_recipe']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/72649-array-question/#findComment-366372 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.