Home php Just get get variable from url

Just get get variable from url

Author

Date

Category

Along the way, I lagged behind life! I can’t find a connection, it seems so simple, but I can’t do it – I feel like a loser: I can’t check if there is any get variable in url and get the value of this get … I know that isset () is being checked, but isset ($ _GET ['']) – gives nothing …


Answer 1, authority 100%

http://mysite.com/blabla/bla.php?key1=val1

if (isset ($ _ GET ['key1'])) {
  var_dump ($ _ GET ['key1']); // val1
}

Answer 2, authority 50%

echo '& lt; pre & gt;'. print_r (array_keys ($ _ GET), true). '& lt; / pre & gt ; ';

foreach ($ _ GET as $ key = & gt; $ value) {
  echo $ key. ' = '. $ value.' & lt; br & gt; ';
}

You will see:

  • Names (keys) of all parameters passed by GET.
  • GET keys and parameters

What is not clear here, and how to help more – no idea


Answer 3, authority 25%

Try it simple

var_dump ($ _ GET ['']);

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions