{"id":1029,"date":"2024-12-17T05:35:22","date_gmt":"2024-12-17T05:35:22","guid":{"rendered":"https:\/\/monkey.ploogie.co.uk\/?page_id=1029"},"modified":"2024-12-17T05:35:22","modified_gmt":"2024-12-17T05:35:22","slug":"mwnci-usort-function","status":"publish","type":"page","link":"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-usort-function\/","title":{"rendered":"Mwnci usort() Function"},"content":{"rendered":"<h2>Syntax<\/h2>\n<p>usort<strong>(<em>array<\/em>)<\/strong><\/p>\n<h2>Description<\/h2>\n<p>The <i>usort()<\/i> function returns a new array sorted in ascending order, with duplicates removed.<\/p>\n<h2>Example<\/h2>\n<pre>\r\na=[5,4,3,3,3,2,1,7,7,7,7,8,8,8,9]\r\nb=usort(a)\r\nprintln(a,\"\\n\", b)\r\na=[\"Eccles\", \"Eccles\", \"Neddie\", \"Grytpipe\", \"Grytpipe\", \"Grytpipe\", \"Moriarty\"]\r\nb=usort(a)\r\nprintln(a,\"\\n\", b)\r\n\r\n[5, 4, 3, 3, 3, 2, 1, 7, 7, 7, 7, 8, 8, 8, 9]\r\n[1, 2, 3, 4, 5, 7, 8, 9]\r\n[\"Eccles\", \"Eccles\", \"Neddie\", \"Grytpipe\", \"Grytpipe\", \"Grytpipe\", \"Moriarty\"]\r\n[\"Eccles\", \"Grytpipe\", \"Moriarty\", \"Neddie\"]\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Syntax usort(array) Description The usort() function returns a new array sorted in ascending order, with duplicates removed. Example a=[5,4,3,3,3,2,1,7,7,7,7,8,8,8,9] b=usort(a) println(a,&#8221;\\n&#8221;, b) a=[&#8220;Eccles&#8221;, &#8220;Eccles&#8221;, &#8220;Neddie&#8221;, &#8220;Grytpipe&#8221;, &#8220;Grytpipe&#8221;, &#8220;Grytpipe&#8221;, &#8220;Moriarty&#8221;] b=usort(a) println(a,&#8221;\\n&#8221;, b) [5, 4, 3, 3, 3, 2, 1, 7, 7, 7, 7, 8, 8, 8, 9] [1, 2, 3, 4, 5, 7, 8, 9] &hellip; <a href=\"https:\/\/monkey.ploogie.co.uk\/index.php\/mwnci-usort-function\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mwnci usort() Function&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1029","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1029","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=1029"}],"version-history":[{"count":1,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1029\/revisions"}],"predecessor-version":[{"id":1030,"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/pages\/1029\/revisions\/1030"}],"wp:attachment":[{"href":"https:\/\/monkey.ploogie.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=1029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}