mercredi 6 janvier 2021

How can I get an array from an If statement?

I'm trying to detect conditions of a string length within input fields. I need to know which condition(s) is met from the if statement and then put that/those in an array to display. Here's my code:

                if(strlen($post['first_name']) > 25
                    || strlen($post['last_name']) > 25
                    || strlen($post['email']) > 40
                    || strlen($post['phone']) > 15
                ){
                  $lengthTooLong = array();  
                  //do this
                }

Aucun commentaire:

Enregistrer un commentaire