Sorry for the confusion here. $name is a variable defined within the create_radio() function (specifically, as an argument). For this reason, $name only has a value within that function. This means that anywhere outside of the function, before the form submission, after, whatever, $_POST[$name] has no value because $name has no value.
However, using the code, the radio buttons created have a name value of 'gallon_price'. So after the form is submitted, $_POST['gallon_price'] has the value of whatever button was checked.
Let me know if that's still unclear.
(Also, you've posted this in a forum for a different book. It'd help if you use the correct forum for any future questions. Thanks!)