array-difference

Subtracting one Array from another in Ruby

I've got two arrays of Tasks - created and assigned. I want to remove all assigned tasks from the array of created tasks. Here's my working, but messy, code: @assigned_tasks = @user.assigned_tasks @created_tasks = @user.created_tasks #Do not show created tasks assigned to self @created_not_doing_tasks = Array.new @created_tasks.e...

PHP: Case-insensitive "array_diff"

I have following two arrays and the code to find array_diff: $obs_ws = array("you", "your", "may", "me", "my", "etc"); $all_ws = array("LOVE", "World", "Your", "my", "etc", "CoDe"); $final_ws = array_diff($all_ws, $obs_ws); Above code giving output array as: $final_ws = array("LOVE", "World", "Your", "CoDe"); But I want it as: $f...

extract values from multidemensional array

I have two arrays that are structured like this $array1 = Array ( [0] => Array ( ['story_id'] => 47789 ) [1] => Array ( ['story_id'] => 47779 ) [2] => Array ( ['story_id'] => 47776 ) [3] => Array ( [...