ec Posted March 28, 2008 Share Posted March 28, 2008 How could I do if phone number is not missing, it must be 13 digits long otherwise errflag comes on? I've attempted several ways but none have worked This is what I have for the 13 digits part of the qry... if(strlen($phone) <> 13) { $errmsg_arr[] = 'Phone Number must be 13 digits long'; $errflag = true; } Link to comment https://forums.phpfreaks.com/topic/98389-if-statements/ Share on other sites More sharing options...
dezkit Posted March 28, 2008 Share Posted March 28, 2008 if(strlen($phone) <> 13) { $errmsg_arr[] = 'Phone Number must be 13 digits long'; $errflag = true; } if($phone <> 13){ echo "Phone number must be 13 digits long"; } Link to comment https://forums.phpfreaks.com/topic/98389-if-statements/#findComment-503515 Share on other sites More sharing options...
ec Posted March 28, 2008 Author Share Posted March 28, 2008 No, that's not it but I got it thanks if(strlen($newphone) <>13) { $errmsg_arr[] = 'Phone Number must be 13 digits long'; $errflag = true; } if($newphone == ''){ $errflag = false; } Link to comment https://forums.phpfreaks.com/topic/98389-if-statements/#findComment-503521 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.