Prmetto che il cookie Userid ha valore 2 e quello Password ha valore 21232f297a57a5a743894a0e4a801fc3
Codice PHP:
function my_getcookie( $name )
{
global $config;
if ( isset( $_COOKIE[$config["cookie_name"] . $name ] ) )
{
return $_COOKIE[$config["cookie_name"] . $name ];
}
}
$a[0] = my_getcookie( "Userid" );
$a[1] = my_getcookie( "Password" );
if ( $a[2] = my_getcookie( "Userid" ) && $a[3] = my_getcookie( "Password" ) )
{
print_r($a);
}
Output:
codice:
Array
(
[0] => 2
[1] => 21232f297a57a5a743894a0e4a801fc3
[2] => 1
[3] => 21232f297a57a5a743894a0e4a801fc3
)
Perchè se assegnato nell'if il risultato di $a[2] = my_getcookie( "Userid" ) è 1 invece di 2?