If I'm correctly guessing what you want to do, you may want to invert the logic a bit, something like:
$subscriptionplan = explode(',', $subscriptionplan);
foreach ($subscriptionplan as $subscribe) {
if ($subscribe == 'Level 1') {
header("Location: level1videos.php");
exit();
}
}
// if we get this far, do the other redirect
header("Location: index.php?level1=notexists");
exit();
That being said, probably the more robust and efficient solution would be to normalize your data and not store multiple values in one DB field. You might use a one-to-many relationship to a separate "subscription plan" table, which would probably be the easiest way to make things easy to change (e.g. if you add new plan types).