Multi-Condition Ifs

I want to take an action ONLY if ALL of the following conditions are ALL true simultaneously.
Condition 1 - The first 2 characters of field A are alphabetic. (AA to ZZ).
Condition 2 - The third and fourth character of field A are numeric (00 to 99).
Condition 3 - The fifth and sixth characters of field A are alphabetic. (AA to ZZ).
Condition 4 - The length of field B is at least 2 characters long.

Suggestions welcome please. Using an old version of PHP and really don’t want to upgrade.

What have you tried?

if ($subfield >= “00” && $subfield <= “99”)
{
$query = "insert into 4entries set
4entries.call = ‘$call’,

The above works and covers condition 2.

If I try adding condition 4 (see below), it doesn’t work.

if ($subfield >= “00” && $subfield <= “99” && strlen($call > 2))
{
$query = "insert into 4entries set
4entries.call = ‘$call’,

Any ideas?

Hi, where exactly you failed?

Sponsor our Newsletter | Privacy Policy | Terms of Service