get URL variable

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


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?

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
Greg AlexanderLead DeveloperCommented:
should be

Greg AlexanderLead DeveloperCommented:
Having two (?) is the problem in other words
Ray PaseurCommented:
PHP has a built-in function to help you avoid problems like this:
RefaelAuthor Commented:

yes of course! thank you so much for alerting me on that.
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.