Array ( [0] => Array ( [questionID] => 47 [surveyID] => 51 [userID] => 31 [question
As an alternative, my way independent of the array structure (assume $x holds your data structure):
if (preg_match('/"required":[01]/',json_encode($x))) { // The array structure contains "required" => 0 or "required" => 1 } else { // Negative }