Ver originalforeach ($row['nick'] as $result) { echo "<a href=\"javascript:void(0)\" onclick=\"javascript:chatWith($result)\"> $result </a><br>"; }