hi i need to compare a value inside the array that is returned via recordset from database
i am trying to use in_array() to search inside the array but in_array() doesnt seem to do so here is the code
[code=php]
$email=$this->input->post('email' );
if(in_array($em ail,$newsletter _array)){
echo 'yes';
}else{
echo 'no';
}
[/code]
i have tried using it this way too
what am i doing wrong
regards,
Omer Aslam
Code:
Array
(
[0] => Array
(
[email] => ranatouqeer@msn.com
)
[1] => Array
(
[email] => omer@etgi.us
)
)
[code=php]
$email=$this->input->post('email' );
if(in_array($em ail,$newsletter _array)){
echo 'yes';
}else{
echo 'no';
}
[/code]
i have tried using it this way too
Code:
if(in_array(array(array('email'=>$email)),$newsletter_array)){
echo 'yes';
}else{
echo 'no';
}
what am i doing wrong
regards,
Omer Aslam
Comment