How can you make a multidimensional array unique?

后端 未结 6 1191
陌清茗
陌清茗 2020-11-27 08:03

I\'ve got a multidimensional array setup like the following:

array(
  [0]=>
  array(
    [\"name\"]=> \"Foo\"
    [\"slug\"]=> \"Bar\"
  )
  [1]=>         


        
6条回答
  •  清酒与你
    2020-11-27 08:34

    Just looking at your particular case, I would recommend using a hash table instead of a 2-dimensional array. If you use your "name" as the key in the hash, each entry would be unique.

    Is there a specific need for the multidimensional array?

提交回复
热议问题