Jump to content

Archived

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

zwebm

Array help

Recommended Posts

Im very new at PHP and have created very simple scripts. is it possoble to add more variables to arrays from a HTML form? i have a simple array like the following...

$game_title = array("Airfox",
"Adrenalin Challenge",
"War Bears",
"Alpha Bravo Charlie",
"A Blast",
"Adventures of Bibo II",
"Air Hockey",
"ALIAS",
"ALIAS 2");

how would i have an HTML form add anothor variable to that array?

Share this post


Link to post
Share on other sites
You can use:

$game_title[] = $_POST['new_element'];

where the new_element is the input submitted....

However if you need to populate the array over several submits...you need to store the original array as arrays cannot be stored across pages...

Share this post


Link to post
Share on other sites

×

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.