title: render data via PDO::FETCH_FUNC vs loop
body: <p>I've been using 2 methods to render data.</p>
  
  <p>The first one:</p>
  
  <pre><code>function name($id,$name){
      return '&lt;div id="'.$id.'"&gt;'.$name.'&lt;/div&gt;';
  }
  echo implode($pdo-&gt;query("SELECT id,name FROM user")-&gt;fetchAll(PDO::FETCH_FUNC,'name'));
  </code></pre>
  
  <p>The second one:</p>
  
  <pre><code>$users = $pdo-&gt;query("SELECT id,name FROM user")-&gt;fetchAll(PDO::FETCH_OBJ);
  foreach($users as $user){
      echo name($user-&gt;id,$user-&gt;name);
  }
  </code></pre>
  
  <p>I don't really understand how <code>PDO::FETCH_FUNC</code> works. I already tried to figure it out. However, this is not so well-documented.</p>
  
  <p>Could anybody please explain this fetch mode? And also, which one performs better? Thank you.</p>