Regular ExpressionReturn to listif(isset($date)){
if ( ereg( "([0-9]{1, 2})/([0-9]{1,2})/([0-9]{4})", $date, $regs ) ) {
echo $regs[0] . "Conversion The result is: " . $regs[3] . "-" . $regs[1] . "-" . $regs[2];
} else {
echo "The date format of $date is wrong! < ;br>";
}
}
?>
http://www.bkjia.com/PHPjc/532483.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532483.htmlTechArticlehtml headtitle regular expression/title/head body a href="./"Return list/a form action= "? echo $PHP_SELF; ?" method="post" Please enter the date in MM/DD/YYYY format: input type="text" name...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn