title: Array check if object key has same value
body: <p>I want to push values from old array to a new array. when pushing I am checking the object value is already exist or not. the value should be pushed only when the same object value is not exist in new array. here is my code.</p>
  <pre><code>$sorted_array = array();
  
  foreach ($data as $nkey =&gt; $value) {
          if (count($sorted_array) &gt; 0) {
              dd($sorted_array[$nkey]);
              if ($sorted_array[$nkey]['store'] != $value['store']) {
                  array_push($sorted_array, $value);
              }
          }
          else{
              array_push($sorted_array, $value);
          }
      }
  </code></pre>