Krooy_mans
Krooy_mans

Reputation: 324

Souble condition in IF statement PHP

Happy easter everyone! :)

Does anyone know what's wrong with this double IF condition:

 if (empty($_POST['request_article_form'])) and empty($_POST['article_number_article_table']))    {//blabla }

Error from IDE: Fix [1/1] Syntax error, unexpected T_LOGICAL_AND on line 37

Upvotes: 0

Views: 39

Answers (2)

Rex Rex
Rex Rex

Reputation: 1030

')' is added extra

Use this

if (empty($_POST['request_article_form']) and empty($_POST['article_number_article_table'])) { 
    // do something
}

Upvotes: 2

pavel
pavel

Reputation: 27102

Just count brackets, you open it 3 times, close 4 times.

if (empty($_POST['request_article_form']) and empty($_POST['article_number_article_table'])) { 
    // do something
}

Upvotes: 0

Related Questions