下面提供了三款日期验证正则表达式哦,你可以根据自己的需选择下面三种中期其中一种日期验证方法
- */
- $arr_date = array(
- '2004-06-01',
- '2005-0x-10',
- '12-12-12',
- '2000-12-25 00:10:20',
- '2007-12-05'
- );
- for ($i=0; $i<5; ++$i)
- {
- $date = $arr_date[$i];
- if(ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs))
- {
- echo "日期字符串$date 符合'yyyy-mm-dd'格式:";
- echo "$regs[1].$regs[2].$regs[3]<br/><br/>";
- }
- else
- {
- echo "<b>日期字符串$date 不符合'yyyy-mm-dd'格式的日期字符串</b><br/><br/>";
- }
- }
- //匹配yyyy-mm-dd
- (([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)
- //2:匹配dd/mm/yyyy 或匹配d/m/yyyy
- '/^(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|'
- .'[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})/((([13578]|1[2])|(0[13578]|1[02])'
- .'/((0[1-9]|[12][0-9]|3[01])|([1-9]|[12][0-9]|3[1])))|(((0[469]|11)|([469]|11))'
- .'/((0[1-9]|[12][0-9]|30)|([1-9]|[12][0-9]|30)))|'
- .'((02|2)/((0[1-9]|[1][0-9]|2[0-8])|([1-9]|[1][0-9]|2[0-8]))'
- .')))|((([0-9]{2})((0[48]|[2468][048]|[13579][26])|([48]|[2468][048]|[13579][26]))|'
- .'((((0[48])|([48]))|[2468][048]|[3579][26])00))/(02|2)/29)$/';
波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站源码并不保证全部能正常使用,仅供有技术基础的人学习研究,请谨慎下载
8. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
波比源码 » 日期验证正则表达式
波比源码 » 日期验证正则表达式
buy levofloxacin 500mg for sale oral levofloxacin 500mg
order buspirone 10mg pills buy amiodarone 100mg pills buy oxybutynin 2.5mg without prescription
buy isosorbide digoxin ca buy micardis 20mg online cheap
buy provera 5mg without prescription biltricide 600mg cost order cyproheptadine 4 mg for sale
zyprexa canada buy generic valsartan 80mg buy valsartan 80mg sale
linezolid 600mg ca linezolid cheap free slot games online
buy priligy 30mg for sale buy synthroid pill buy synthroid pill
flagyl 400mg uk order metronidazole sale bactrim 960mg oral
trazodone 100mg pills trazodone 50mg sale aurogra cost
retin cream without prescription retin gel drug order avana 100mg
naproxen 500mg for sale cefdinir 300 mg pill prevacid sale
pioglitazone pills order generic sildenafil 100mg cost viagra
cialis pills 20mg Approved cialis best online poker sites
online poker sites free welcome spins no deposit free slots
poker online play slot games play online blackjack for real money
online blackjack with friends canada pharmacy write research papers
order temovate sale clobetasol drug purchase amiodarone for sale
cheap diamox 250mg isosorbide for sale online azathioprine over the counter
oral coreg 25mg order ditropan 2.5mg without prescription order elavil 10mg generic
alendronate 35mg oral furadantin order online ibuprofen 600mg cheap
pepcid pills purchase famotidine online cheap remeron 15mg cheap
buy ropinirole 2mg without prescription cheap trandate labetalol tablet
order tadacip online trimox over the counter amoxicillin without prescription
esomeprazole 40mg ca clarithromycin 250mg uk furosemide pill
tadalafil 5mg cost tadalafil low price cheap viagra generic
canadian drugs online pharmacy
order tadalafil for sale Cialis prices buy best erectile dysfunction pills
clomid usa order atorvastatin online brand prednisolone 40mg
order prednisone 5mg generic buy deltasone online cheap amoxil 1000mg uk
order generic isotretinoin 40mg buy deltasone 5mg online cheap buy generic ampicillin 250mg
fildena drug generic pregabalin 75mg propecia 1mg pills
buy ondansetron 8mg sale zofran order buy generic bactrim 960mg
order provigil 100mg sale zestril 5mg without prescription lopressor 50mg oral
azathioprine 50mg ca oral imuran order naproxen 250mg sale