This is my code to check if the field is empty and it works fine, however i want to check for both, if its empty and if its got less than 10 characters
<pre>
if(empty($_POST['comments'])){ $errors[]="Please enter a comment."; }
</pre>
I tried this
<pre>
if(empty($_POST['comments'])){ $errors[]="Please enter a comment."; }
if(strlen($_POST['comments']) > 10){ $errors[]="Please enter a comment."; }
</pre>
However this then made neither work so i tried which had the same result with neither of them working
<pre>
if(empty($_POST['comments']) && strlen($_POST['comments']) > 10)){ $errors[]="Your
comment must be longer than 10 characters."; }
</pre>
I have tried mb_strlen as well but that changed nothing.