vendredi 8 octobre 2021

Php simplify if else statements thank

I have this if statements, i want to simplify this can anyone help me to do it please ? I just want to put the variable to 0 if it is empty.

             $items[29]=0;
            }
            if (empty($items[30])){
                $items[30]=0;
               }
               if (empty($items[31])){
                $items[31]=0;
               }
               if (empty($items[32])){
                $items[32]=0;
               }
               if (empty($items[33])){
                $items[33]=0;
               }
               if (empty($items[34])){
                $items[34]=0;
               }
               if (empty($items[35])){
                $items[35]=0;
               }
               if (empty($items[36])){
                $items[36]=0;
               }
               if (empty($items[37])){
                $items[37]=0;
               } ```
Thank you :)

Aucun commentaire:

Enregistrer un commentaire