|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Arrays & URL's
Hello,
i Have a simple question, hopefully the answer is simple. How would i be able to take variables from a URL and assign the values to an array if the varialbes passed in the URL all have the same name. For example. HTTP://localhost/test.php?test=valueone&test=valuetwo&test=valuethree my code is written like so: $testarray = array ($_GET['test']); the problem with this code is that after the code is executed the array only contains one value but i need all those three values inside my array. thanks in advance for any input. |
|
#2
|
||||
|
||||
|
If you change the field name so that it contains brackets, you'll be good to go:
HTTP://localhost/test.php?test[]=valueone&test[]=valuetwo&test[]=valuethree $testarray=$_GET["test"];
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
|
#3
|
|||
|
|||
|
Arrays and URL's thank you
i would like to offer you my first born son as a gratitude... whooooo..... it vworked thanks......
|
|
#4
|
||||
|
||||
|
Heh, glad to help. I'll let you off on the offer of your firstborn son -- I've got a daughter due in about a week.
|
|
#5
|
|||
|
|||
|
awesome congratulations!!! prepare for one heck rollercoaster ride!!!!
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Arrays & URL's |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|