<?php
$line = 'What is a dog?, A pet, A human, A house, A train';
//This code assumes no commas in the question or answers.
$answers = explode(',', $line);
//pull the question into a variable
$question = $answers[0];
//remove the question from the list of answers
unset($answers[0]);
//add the array to your result array
$result[]=array('question'=>$question, 'answers'=>$answers );
$line = 'What is a car?, A vehicle, A tool, A number, A person';
//This code assumes no commas in the question or answers.
$answers = explode(',', $line);
//pull the question into a variable
$question = $answers[0];
//remove the question from the list of answers
unset($answers[0]);
//add the array to your result array
$result[]=array('question'=>$question, 'answers'=>$answers );
var_dump($result);
?>