<?php
$OKmassive = [
'id' => '666',
'name' => 'Petyan',
'age' => '18',
'email' => 'bitard@gmail.com',
'password' => '1488',
'birthday' => '11.09.2001',
'ip' => '127.0.0.0',
'time' => '02:39',
'token' => 'chto?',
'source' => 'www.2ch.hk/b'
];
$BADmassive = [
'id' => '666',
'sex' => 'Petyan',
'age' => '18',
'email' => 'bitard@gmail.com',
'password' => '1488',
'birthday' => '11.09.2001',
'ip' => '127.0.0.0',
'time' => '02:39',
'token' => 'chto?',
'source' => 'www.2ch.hk/b'
];
function checking($mas){
$rightKeys = ['id', 'name', 'age', 'email',
'password', 'birthday', 'ip',
'time', 'token', 'source'];
$i = 0;
foreach($mas as $key => $data){
$a = ($key != $rightKeys[$i])? "suka" : "ok";
if ($a == "suka"){
return "pizdec";
}
$i++;
}
return "zaebis";
}
$result = checking($OKmassive);
echo "$result";
?>
PD9waHAKCSRPS21hc3NpdmUgPSBbCgkJJ2lkJyA9PiAnNjY2JywKCQknbmFtZScgPT4gJ1BldHlhbicsCgkJJ2FnZScgPT4gJzE4JywKCQknZW1haWwnID0+ICdiaXRhcmRAZ21haWwuY29tJywKCQkncGFzc3dvcmQnID0+ICcxNDg4JywKCQknYmlydGhkYXknID0+ICcxMS4wOS4yMDAxJywKCQknaXAnID0+ICcxMjcuMC4wLjAnLAoJCSd0aW1lJyA9PiAnMDI6MzknLAoJCSd0b2tlbicgPT4gJ2NodG8/JywKCQknc291cmNlJyA9PiAnd3d3LjJjaC5oay9iJwoJXTsKCSRCQURtYXNzaXZlID0gWwoJCSdpZCcgPT4gJzY2NicsCgkJJ3NleCcgPT4gJ1BldHlhbicsCgkJJ2FnZScgPT4gJzE4JywKCQknZW1haWwnID0+ICdiaXRhcmRAZ21haWwuY29tJywKCQkncGFzc3dvcmQnID0+ICcxNDg4JywKCQknYmlydGhkYXknID0+ICcxMS4wOS4yMDAxJywKCQknaXAnID0+ICcxMjcuMC4wLjAnLAoJCSd0aW1lJyA9PiAnMDI6MzknLAoJCSd0b2tl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