@underbottom/

repeat1

PHP (Legacy)

No description

fork
loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.816016872762628","path":"main.php","file":{"path":"main.php","content":{"asEncoding":{"base64":"PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7Cm1iX2ludGVybmFsX2VuY29kaW5nKCd1dGYtOCcpOwoKCgoKJGJhc2VOdW1iZXJzPVsKICAnOC05MTEtNDA0LTQ0LTExJywnKzcoODEyKTY3ODY3NjcnLCAgJzg0OTUxMjM0NTY3JywgICcrNzQ5NTEyMzQ1NjcnLCAnOC00OTUtMS0yMzQtNTY3JywKICAnIDggKDgxMjIpIDU2LTU2LTU2JywgJzgtOTExLTEyMzQ1NjcnLCAnOCAoOTExKSAxMiAzNDUgNjcnLAogICc4LTkxMSAxMiAzNDUgNjcnLCAnOCAoOTExKSAtIDEyMyAtIDQ1IC0gNjcnLCAnKyA3IDk5OSAxMjMgNDU2NycsCiAgJzggKCA5OTkgKSAxMjM0NTY3JywgJzggOTk5IDEyMyA0NTY3JywgJzAyJywgJzg0OTUxMjM0NTY3INC/0L7Qt9Cy0LDRgtGMINC70Y7RgdGOJywKICAnODQ5NTEyMzQ1JywgJzg0OTUxMjM0NTY3OCcsCiAgJzggKDQwOSkgMTIzLTEyMy0xMjMnLCAnNzkwMDEyMzQ2NycsICc1MDA1MDA1MDAxJywgJzg4ODgtODg4OC04OCcsCiAgJzg0OTUxYTIzNDU2NycsICc4NDk1MTIzNDU2YScsCiAgJysxIDIzNCA1Njc4OTAxJywKICAnKzggMjM0IDU2Nzg5MDEnLAogICc3IDIzNCA1Njc4OTAxJwpdOwoKJGkgPSAwOwokbnVtYmVyID0gIiI7Cgpmb3JlYWNoICgkYmFzZU51bWJlcnMgYXMgJGtleSA9PiAkcGhvbmUpIHsKICAkbnVtYmVyID0gJHBob25lOwogIC8q0L7Rh9C40YnQsNC10Lwg0L3QvtC80LXRgCovCiAgJHBob25lID0gcHJlZ19yZXBsYWNlKCIvWygpXHNcLV0vIiwiIiwkcGhvbmUpOwogICRwaG9uZSA9IHByZWdfcmVwbGFjZSAoIi9cKzcvIiwiOCIsJHBob25lKTsKICBpZiAocHJlZ19tYXRjaCAoIi9eOFtcZF17MTB9JC91aSIsJHBob25lKSkgewogICAgIGVjaG8gInskcGhvbmV9IC0g0L3QvtC80LXRgCDQv9GA0L7RiNGR0Lsg0L/RgNC+0LLQtdGA0LrRgyDQuCDQsdGL0Lsg0L/RgNC40LLQtdC00ZHQvSDQuiDRgdGC0LDQvdC00LDRgNGC0L3QvtC80YMg0LLQuNC00YMuXG4iOwogIH1lbHNlewogICAgIGVjaG8gInskbnVtYmVyfSAtINC90L7QvNC10YAg0LIg0L3QtdC/0YDQsNCy0LjQu9GM0L3QvtC8INGE0L7RgNC80LDRgtC1XG4iOwogICAgICRpKys7CiAgfQp9CgplY2hvICItLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxueyRpfSAtINC90L7QvNC10YDQvtCyINC90LUg0L/RgNC+0YjQtdC00YjQuNGFINC/0YDQvtCy0LXRgNC60YNcbiI7Cgo/Pg=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php

error_reporting(-1);
mb_internal_encoding('utf-8');




$baseNumbers=[
  '8-911-404-44-11','+7(812)6786767',  '84951234567',  '+74951234567', '8-495-1-234-567',
  ' 8 (8122) 56-56-56', '8-911-1234567', '8 (911) 12 345 67',
  '8-911 12 345 67', '8 (911) - 123 - 45 - 67', '+ 7 999 123 4567',
  '8 ( 999 ) 1234567', '8 999 123 4567', '02', '84951234567 позвать люсю',
  '849512345', '849512345678',
  '8 (409) 123-123-123', '7900123467', '5005005001', '8888-8888-88',
  '84951a234567', '8495123456a',
  '+1 234 5678901',
  '+8 234 5678901',
  '7 234 5678901'
];

$i = 0;
$number = "";

foreach ($baseNumbers as $key => $phone) {
  $number = $phone;
  /*очищаем номер*/
  $phone = preg_replace("/[()\s\-]/","",$phone);
  $phone = preg_replace ("/\+7/","8",$phone);
  if (preg_match ("/^8[\d]{10}$/ui",$phone)) {
     echo "{$phone} - номер прошёл проверку и был приведён к стандартному виду.\n";
  }else{
     echo "{$number} - номер в неправильном формате\n";
     $i++;
  }
}

echo "--------------------------------------------\n{$i} - номеров не прошедших проверку\n";

?>
PHP 7.0.8 (Legacy: use the following for new features: Command-line PHP: https://repl.it/languages/php_cli PHP Web Server: https://repl.it/languages/php7