I have a foreach loop like this.
if ( is_object($res_two)) {
if($res_two->num_rows() == 0) {
echo "No Records Found";}
else if( $res_two->num_rows() > 0) {
foreach ($res_two->result() as $row ) {
echo $row->js_id."\t". $row->designation."\t".$row->full_name."\t".$row->location."\t".$row->graduated_in."\t";
$mail2 = $row->email;
echo $mail2 ;
?> <a href="<?php echo base_url("uploads/".$row->resume."")?>">Download Resume</a> <br/><br/> <?php
}
}
}
?>
Now I want to extract $mail2 details. However echoing $mail2 out of the code giving only one value instead of an array(if foreach loop iterates, it should have multiple values?).
How to get the multiple values of $mail2 outside the code?
$mails[] = $row->email