How to print out usernames using EntityFieldQuery I'm trying to filter users using entityfieldquery (type 'user') by fieldConditions, but I don't know how to print out the usernames on a page. If I use "print_r", it works. But I don't want to print them out on a white page. ^^ If I use $output, I get only one name. For nodes, there is a function "node_view_multiple" to use it like $output = node_view_multiple($nodes);
Is there also a way for entity_type user?

Here is my code:

global $user;
$angemeldeter_user = user_load($user-&gt;uid); 
$alter = $angemeldeter_user-&gt;field_alter['und'][0]['value'];
$alter_faktor = 4;
$alter_untergrenze = $alter - $alter_faktor;
$alter_obergrenze = $alter + $alter_faktor;

$query = new EntityFieldQuery();
$query-&gt;entityCondition('entity_type', 'user')
-&gt;fieldCondition('field_alter', 'value', array($alter_untergrenze, $alter_obergrenze), 'BETWEEN');
$result = $query-&gt;execute();

if (isset($result['user'])){   
global $user; 
$angemeldeter_user = user_load($user-&gt;uid);                                         
$users=user_load_multiple(array_keys($result['user']));
dpm($users);

foreach($users as $value) {
  $user_list = (array)$value;
  $users[$user_list['uid']] = $user_list['name'];
  $output = '';
  $output .= $user_list['name'];
  return $output;
  }
  }
  else{
    $hihi = 'no results';
    return $hihi;
  }
}
Since user_load_multiple() returns an array of user objects you need to use the '->' in order to access them.

$output = '';
foreach ($users as $key =&gt; $value) {
  $output .= "index: $key; name: $value-&gt;name&lt;br /&gt;";
}
return $output;