get URL variable


in a URL i am passing variables in the following form:

?void=84?cid=46

i am trying to retrieve the cid variable using the $_GET function but something is not working.
when i am using "print_r($_GET);" this is what is prints:

Array ( [void] => 84?cid=46 )

how do i get the cid value back from the URL?


RefaelAsked:
Who is Participating?
 
Greg AlexanderConnect With a Mentor Lead DeveloperCommented:
The (?) notes the beginning of the query string... and to appended it you will use (&) for each variable after that
0
 
Greg AlexanderLead DeveloperCommented:
should be


?void=84&cid=46
0
 
Greg AlexanderLead DeveloperCommented:
Having two (?) is the problem in other words
0
 
Ray PaseurCommented:
PHP has a built-in function to help you avoid problems like this:
http://php.net/manual/en/function.http-build-query.php
0
 
RefaelAuthor Commented:

yes of course! thank you so much for alerting me on that.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.