I have a form with a user input box for entering a date in the format of MM/DD/YYYY and store it in a variable called $date. Once the user submits the information I use my php script to process and validate the information he/she has entered. Well I'm trying to use the strlen() function to verify that the user has entered the correct length string which I assume would be a string length of ten.
Code: Select all
<?php
if (strlen($date) < 10 );
{
echo "Please enter correct date format";
{
else
}
// continue processing form;
}
?>Could someone please help point me in the right direction or give me an example of what they think the code should be structured to complete the task of checking the user input?
Thanks in advance everyone.