fork download
  1. <?php
  2.  
  3. $resultArray = array(
  4. "id" => "123",
  5. "name" => "Albert",
  6. "age" => "22",
  7. "email" => "darkstar@gmail.com",
  8. "password" => "12345",
  9. "birthday" => "12 september",
  10. "ip" => "127.0.0.1",
  11. "time" => "21:00",
  12. "token" => "to-ken",
  13. "source" => "sour--ce"
  14. );
  15. $checkArray = array(
  16. "id",
  17. "name",
  18. "age",
  19. "email",
  20. "password",
  21. "birthday",
  22. "ip",
  23. "time",
  24. "token",
  25. "source"
  26. );
  27. $resultArray1 = array_flip($resultArray);
  28. $result = array_diff($checkArray, $resultArray1);
  29. if (count($result) == 0 && count($resultArray) == count($checkArray)) {
  30. echo "Всё правильно";
  31. } else {
  32. echo "Ничего не правильно";
  33. }
  34. ?>
Success #stdin #stdout 0.02s 24400KB
stdin
Standard input is empty
stdout
Всё правильно