php 相關

日期只擷取年月日
 substr($date,0,10); 
年月日正則
preg_match("/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/",$date); 

留言