"; $Ans = trim(fgets(STDIN)); if ((mb_strtoupper($Ans) != "Y") && (mb_strtoupper($Ans) != "N")) { echo "-- End of TelephoneCheck Test --\n\n"; exit; } if (mb_strtoupper($Ans) == "Y") { # コンソールで何も入力せずに即リターンしたら終了 while (TRUE) { echo "PhoneNumber [ TelCode , Action ] > "; $Arg = trim(fgets(STDIN)); # 電話番号,Action をコンソール入力 if ($Arg == "") { echo "-- End of TelephoneCheck Test --\n\n"; break; } $ArgList = explode(",", $Arg); if (count($ArgList) != 2) { echo "Please enter [ TelCode , Action ]\n"; } else { $Result5 = PhoneNumber(trim($ArgList[0]), trim($ArgList[1])); echo ( mb_strtoupper(var_export((bool)$Result5, true)) . " [ " . (string)$Result5 . " ]\n"); } } } else { // コンソールで何も入力せずに即リターンしたら終了 while (TRUE) { echo "TelephoneCheck > "; $TelCode = trim(fgets(STDIN)); // 電話番号をコンソール入力 if ($TelCode == "") { echo "-- End of TelephoneCheck Test --\n\n"; break; } $Result1 = GetTypeTelephone($TelCode); // EditType 1: xx-xx-xx , 2: xx(xx)xx , 3: (xx)xx-xx $Result2 = FormatTelephone($TelCode, 1); $Result3 = ValidateTelephone($Result2["TelEdit"]); // 編集電話番号 $Result4 = ValidateTelephone($TelCode); // 数字のみ電話番号 echo ("\n TelCode= [ " . $TelCode . " ]" . "\n-- GetTypeTelephone --" . "\n TelType= " . $Result1["TelType"] . "\n SizeAll= " . $Result1["SizeAll"] . "\n Size1= " . $Result1["Size1"] . "\n Size2= " . $Result1["Size2"] . "\n Size3= " . $Result1["Size3"] . "\n ErrId= " . $Result1["ErrId"] . "\n\n-- FormatTelephone --" . "\n TelType= " . $Result2["TelType"] . "\n EditType= " . $Result2["EditType"] . "\n TelEdit= " . $Result2["TelEdit"] . "\n ErrId= " . $Result2["ErrId"] . "\n\n-- ValidateTelephone [1] -- ( " . $Result2["TelEdit"] . " )" . "\n TelType= " . $Result3["TelType"] . "\n EditType= " . $Result3["EditType"] . "\n TelEdit= " . $Result3["TelEdit"] . "\n ErrId= " . $Result3["ErrId"] . "\n\n-- ValidateTelephone [2] -- ( " . $TelCode . " )" . "\n TelType= " . $Result4["TelType"] . "\n EditType= " . $Result4["EditType"] . "\n TelEdit= " . $Result4["TelEdit"] . "\n ErrId= " . $Result4["ErrId"] . "\n\n"); } } ?>