I've looked around but have not found an answer to this apparently trivial question.
What question?
See, I want to set a get parameter as a boolean flag that will be processed with PHP.
What I mean is, I want to perform a certain action only if the parameter is set.
For example:
Show a special banner if there is a get parameter called show_special_banner.
Don't show it if there isn't a get parameter with such name.
Specifically, processing it with isset()
Why I wonder?
Because I have always seen it with generic values like:
?whatever=1
?whatever=yes
?whatever=on
But I actually have never seen it as:
?whatever&something_else=value
What have you tried? Does it work?
I have tried not adding a value and it works with PHP 8.0 on Mozilla Firefox 106.05.
But maybe I'm missing something relevant, like... it could be some specific browser or even older PHP version ignores the parameter if it doesn't have a value for example.
And that's why I ask, to know if it's safe to just omit it, for the sake of it working fine for at least 98% of people using this.