I\'m sure this question has been asked before, my apologies for not finding it first.
The original array:
[0] => Array ( [categoryId]
You could use array_filter, and pass in a function based on the desired key.
Tadeck's answer is way better though.