これは非常に悪い考えであるという他のすべての回答に同意する必要がありますが、既存の回答はそれぞれ、それを達成するためにやや遠回りの方法を使用しています。
PHP は、変数を配列から現在のスコープに抽出するための関数extractを提供します。この場合、次のように使用できます (explode と array_combine を使用して、最初に入力を連想配列に変換します)。
$choices = $_POST['choices'] ?: ""; // The ?: "" makes this safe even if there's no input
$choiceArr = explode(',', $choices); // Break the string down to a simple array
$choiceAssoc = array_combine($choiceArr, $choiceArr); // Then convert that to an associative array, with the keys being the same as the values
extract($choiceAssoc, EXTR_SKIP); // Extract the variables to the current scope - using EXTR_SKIP tells the function *not* to overwrite any variables that already exist, as a security measure
echo $banana; // You now have direct access to those variables
これが不適切なアプローチである理由の詳細については、廃止されたregister_globals設定に関する説明を参照してください。要するに、安全でないコードを書くのがはるかに簡単になります。