Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
これに正規表現を使用するかどうかはわかりません。ユーザーから日付と時刻の 2 つの入力を取得します。
私はフォーマットが
$date = 25/3 $time = 14:30
どうすればこれを確認できますか? 私が持っているアイデアの 1 つは、たとえば $time のように爆発または分割して使用する14こと:です30。しかし、ユーザーが入力するとどうなりますか144:25?
14
:
30
144:25?
それが私が望むフォーマットであることを確認する良い方法を教えてもらえますか?