To improve parse/handling of your $_GET
parameters from your querystring, you can change the syntax to be like this:
Website.com/letter?name[]=Jim&name[]=Patrick
Then $_GET['name']
will hold: array('Jim','Patrick')
.
With $_GET
now being multidimensional, you can iterate the names by running:
foreach($_GET['name'] as $name){
// echo $name // do whatever
}
or you can call implode('&', $_GET['name'])
or similar.
See this post which discusses the topic that tadman is warning you about.
Finally, if you just want to space-separate your names and submit them from a single form field (or hardcode a url), then your receiving code will just need to explode(' ',$_GET['name'])
and then re-stitch the names together with whatever character/substring you choose.
Your question is a little ambiguous, so just in case Jim Patrick
is actually only one person, you don't need to change anything. The name
value will be all of the text after name=
until the end of the url string or until a #
or &
is encountered (assuming you are dealing with a valid url).