. -, (boolean) PHP, :
$hopefullyBool = (boolean)$_GET['myVar'];
true false $_GET['myVar'].
5.2.1, json_decode() :
$hopefullyBool = json_decode($_GET['myVar]);
json_decode() JSON- ( ) PHP . 'true' URL true.
, :
$hopefullyBool = (boolean)json_decode($_GET['myVar]);
, URL ( strtolower() ?myVar=True ?myVar=FALSE), strtolower(), :
$hopefullyBool = (boolean)json_decode(strtolower($_GET['myVar]));
, false URL, PHP . isset():
$hopefullyBool = false;
if ( isset($_GET['myVar']) ) {
$hopefullyBool = (boolean)json_decode(strtolower($_GET['myVar]));
}
, $hopefullyBool , :
$hopefullyBool = isset($_GET['myVar']) && (boolean)json_decode(strtolower($_GET['myVar']));