{"id":3205,"date":"2012-05-07T11:29:05","date_gmt":"2012-05-07T11:29:05","guid":{"rendered":"http:\/\/phpcodez.com\/?p=3205"},"modified":"2012-05-07T11:29:05","modified_gmt":"2012-05-07T11:29:05","slug":"array_udiff_uassoc","status":"publish","type":"post","link":"http:\/\/phpcodez.com\/array_udiff_uassoc\/","title":{"rendered":"array_udiff_uassoc"},"content":{"rendered":"<div>It finds the difference of arrays with additional index check, compares data and indexes by a callback function<\/p>\n<p><strong>Example<\/strong><\/p>\n<p>&lt;?php<br \/>\nfunction func1($arg1,$arg2)<br \/>\n{<br \/>\nif ($arg1===$arg2)<br \/>\n{<br \/>\nreturn 0;<br \/>\n}<br \/>\nreturn 1;<br \/>\n}<\/p>\n<p>function func2($arg1,$arg2)<br \/>\n{<br \/>\nif ($arg1===$arg2)<br \/>\n{<br \/>\nreturn 0;<br \/>\n}<br \/>\nreturn 1;<br \/>\n}<br \/>\necho &#8220;&lt;pre&gt;&#8221;;<br \/>\n$array1=array(&#8220;a&#8221;=&gt;&#8221;PHP&#8221;,&#8221;b&#8221;=&gt;&#8221;JSP&#8221;,&#8221;c&#8221;=&gt;&#8221;ASP&#8221;);<br \/>\n$array2=array(&#8220;a&#8221;=&gt;&#8221;PHP&#8221;,&#8221;b&#8221;=&gt;&#8221;AS&#8221;,&#8221;c&#8221;=&gt;&#8221;Js&#8221;);<br \/>\nprint_r(array_udiff_uassoc($array1,$array2,&#8221;func1&#8243;,&#8221;func2&#8243;));<br \/>\n?&gt;<\/p>\n<p><strong>Output<\/strong><\/p>\n<p>Array<br \/>\n(<br \/>\n[b] =&gt; JSP<br \/>\n[c] =&gt; ASP<br \/>\n)<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>It finds the difference of arrays with additional index check, compares data and indexes by a callback function Example &lt;?php function func1($arg1,$arg2) { if ($arg1===$arg2) { return 0; } return 1; } function func2($arg1,$arg2) { if ($arg1===$arg2) { return 0; } return 1; } echo &#8220;&lt;pre&gt;&#8221;; $array1=array(&#8220;a&#8221;=&gt;&#8221;PHP&#8221;,&#8221;b&#8221;=&gt;&#8221;JSP&#8221;,&#8221;c&#8221;=&gt;&#8221;ASP&#8221;); $array2=array(&#8220;a&#8221;=&gt;&#8221;PHP&#8221;,&#8221;b&#8221;=&gt;&#8221;AS&#8221;,&#8221;c&#8221;=&gt;&#8221;Js&#8221;); print_r(array_udiff_uassoc($array1,$array2,&#8221;func1&#8243;,&#8221;func2&#8243;)); ?&gt; Output Array ( [b] =&gt; &hellip; <a href=\"http:\/\/phpcodez.com\/array_udiff_uassoc\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">array_udiff_uassoc<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[54,213,370],"class_list":["post-3205","post","type-post","status-publish","format-standard","hentry","category-php","tag-array","tag-functions","tag-php"],"_links":{"self":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/3205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/comments?post=3205"}],"version-history":[{"count":0,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/3205\/revisions"}],"wp:attachment":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/media?parent=3205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/categories?post=3205"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/tags?post=3205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}