Ben böyle tarih için bir html giriş kutusu oluşturmak için nasıl anlamaya çalışıyorum sorunlar yaşıyorum:
YYYY-MM-DD
I was wondering if there is a better method of doing this than me manually creating something like this, and then using the - separators to separate the YYYY-MM-DD.
Kullanıcı bu 21 daha büyük olduğundan emin olmak için doğum tarihini girdikten sonra bazı doğrulama yapmak için regex kullanarak olacaktır.
<label for="dob">Age (YYYY-MM-DD)</label>
<input id="dateofbirth" type="text" name="age" maxlength="10"/><span>*</span><br />
İşte php tarafında fonksiyon checkdate içinde olacaktır tarih benim regex olduğunu:
return preg_match('/(\d{4})-(\d{2})-(\d{2})/', $date);
Set date such that it will only take input from users over 21.
Currently this does not.
$date = '1974-12-03';