Below is the array ($answers), you can see the $id in the last array item:
14 => array (
"Joghurtos zabkása",
"Joghurt zabbal",
"Joghurt zabpehellyel",
"Reggeli zabbal",
"Egyéb <input type=\"text\" name=\"poll".$id."\" style=\"width:100px; \" value=\"\" /> "
Inside the function:
function NewPoll($id,$type,$optional=false){
global $answers;
foreach ( $answers[$id] as $key => $value ) {
echo "
<input type=\"radio\" name=\"poll".$id."\" id=\"poll".$id."[".$key."]\" value=\"".$key."\" />
<label for=\"poll".$id."[".$key."]\">".$value."</label><br />";
}
What I want to do is, when I am printing from the function, through the $value variable, the $id, which is from the array, should be get the $id in the function. The $id gets value in the function, and not definied outside it, but I want to use it, when it is loaded into. I don't know how clear am I...