An else if
statement must always correspond to a beginning if
statement on the same "nesting level".
Your inner else if
does not have any beginning if
statement and it therefore fails.
if ($AD == 1) {
if ($AC == '') {
echo 'empty';
}
}
else {
otherFunction($AD);
}
Since this is basic PHP (actually IFs are mostly not language-dependent) stuff, I recommend you reading a beginner's tutorial.