Welcome Guest, Not a member yet? Register   Sign In
Compare 2 arrays
#1

[eluser]Unknown[/eluser]
Assume I have this array

Code:
$month = array("Jan", "Feb", "March", "April", "May" ....);

and I have this query

Code:
$sql = $this->db->get("activity");
$query = $sql->result();

foreach($query as $row_month){
  echo $row_month->month; //echo "March", "May" ...
}

My question : How can I compare $month array against $query array and remove any same value?

I google and find array_diff function but I dont know how to play with this assoc array return by $query

Thanks fellas!




Theme © iAndrew 2016 - Forum software by © MyBB