Jump to content

Array Question


We Must Design

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/72649-array-question/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/72649-array-question/#findComment-366290
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.