I'm trying to resolve my problem.
- I store array in json file
- I try to foreach array and compare it with my GET arguments
Problem was that only last of array filed works but other not.
auth.json
[{"License":"21X2-214X-SSDF-3215-SFFA","IP":"111111111","Note":"x1"},{"License":"S31S-SAF3-XF22-SLLT-341D","IP":"1111111","Note":"x2"}]
PHP Code
$license = json_decode(file_get_contents('auth.json'), true);
foreach ($license as $cec) {
if ($_GET["license"] == $cec["License"] AND $_GET["IP"] == $cec["IP"]){
$user_auth = array(
"user_info" => array(
"auth" => 1
),
);
}else{
$user_auth = array(
"user_info" => array(
"auth" => 0
),
);
}
}