$ver2[0]) { echo "OK"; } elseif ($ver1[0] == $ver2[0]){ if ($ver1[1] > $ver2[1]) { echo "OK"; } elseif ($ver1[1] == $ver2[1] && $ver1[2] >= $ver2[2]){ echo "OK"; } elseif ($ver1[1] == $ver2[1] && $ver1[2] < $ver2[2]) { echo "NO"; } elseif ($ver1[1] < $ver2[1]) { echo "NO"; } } elseif ($ver1[0] < $ver2[0]) { echo "NO"; }