title: PHP: Check duplicate array key in objects array.
body: <p>I have an objects array as following   </p>
  
  <blockquote>
  <pre><code> [{"ChannelName":"39-40","Text":"haha"},
    {"ChannelName":"39-40","Text":"lala"}
    {"ChannelName":"40-41","Text":"bla bla"},
    {"ChannelName":"40-41","Text":"kha kha"}]
  </code></pre>
  </blockquote>
  
  <p>How can I check duplicate value in ChannelName. What I need to do is when ChannelName exists in array object, I want to replace the ChannelName with new Text. How php check duplicate ChannelName and how to replace of old Text attribute with new Text attribute if ChannelName duplicate?</p>