From 43ff1dd68d1698764ae8620fbd52b77de74254f0 Mon Sep 17 00:00:00 2001 From: "Msk, Nikita" <88129731+MicardinaFoundation@users.noreply.github.com> Date: Sun, 30 Apr 2023 18:47:13 +0500 Subject: [PATCH] Create Luna.php --- Luna/Luna.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Luna/Luna.php diff --git a/Luna/Luna.php b/Luna/Luna.php new file mode 100644 index 0000000..972b109 --- /dev/null +++ b/Luna/Luna.php @@ -0,0 +1,35 @@ +9) + $arrNumb[$i]-=9; +} + + + +$answer = ["isValid" => "false", "paymentSystem" => "none"]; + +if (array_sum($arrNumb)%10===0) { + $answer["isValid"] = "true"; + if ($cardNumb[0]==4) + $answer["paymentSystem"] = "VISA"; + elseif ($cardNumb[0]==5) + $answer["paymentSystem"] = "Mastercard"; + elseif ($cardNumb[0]==2 and $cardNumb[1]==2 and $cardNumb[2]==0) + $answer["paymentSystem"] = "MIR"; + else + $answer["paymentSystem"] = "UNKNOWN"; +} + +print_r($answer); + +?>