It's OK to use more than one condition. Sometimes, it's impractical to combine it all into one conditional... My only question, though, is this; Don't you need to account for the 'Y' coordinates too? Also, do you need to account for diagonal distances too? This sounds like it is more than just comparing the x values, but it's your program, so you know what you need it to do. This should help you along. Let us know if you need further guidance.
if($enemyinfo[x] < ($userinfo[x]-2) || $enemyinfo[x] > ($userinfo[x]+2)) {
echo "no";
}