array-unique

php array_unique

HAy, i have an array Array( [0] => Array ( [0] => 33 [user_id] => 33 [1] => 3 [frame_id] => 3 ) [1] => Array ( [0] => 33 [user_id] => 33 [1] => 3 [frame_id] => 3 ) [2] => Array ( [0] => 33 [user_id] => 33 [1] => 8 [frame...

Trouble with array_unique

print_r($tokens); $tokens = array_unique($tokens); print_r($tokens); Gives the following output: Array ( [0] => Array ( [Class_ID] => 32709 ) [1] => Array ( [Class_ID] => 34682 ) [2] => Array ( [Class_ID] => 34818 ) ) Array ( [0] => ...

php - counting if in_array?

I have an array that looks like the one below. I'm trying to group and count them, but haven't been able to get it to work. The original $result array looks like this: Array ( [sku] => Array ( [0] => 344 [1] => 344 [2] => 164 ) [cpk] => Array ( [0] => d...

Removing duplicates with array_unique

I created a image uploader which works by remote, so whenever a user enters a bunch of links, I want to prevent duplicate links being added so that the image isn't copied twice and is removed so it leaves the links to be unique without any duplicates. $break = explode("\n", $links); $count = count($break); $unique_images = array(); fo...