0) { while ($row = mysqli_fetch_assoc($result)) { $email_list[] = $row['offiial_email_id']; } } $email_list= json_encode($email_list); $_SESSION ["_EMAIL_LIST"] = $email_list; } return $email_list; }