How can we get unique elements from any ORDER BY DECREASING OR INCREASING <p>Code given below is taken from the stackoverflow.com !!! Can anyone tell me how to get the array elements order by decreaseing or increasing !! plz help me !!! Thanks in advance</p> <pre><code>$contents = file_get_contents($htmlurl); // Get rid of style, script etc $search = array('@&lt;script[^&gt;]*?&gt;.*?&lt;/script&gt;@si', // Strip out javascript '@&lt;head&gt;.*?&lt;/head&gt;@siU', // Lose the head section '@&lt;style[^&gt;]*?&gt;.*?&lt;/style&gt;@siU', // Strip style tags properly '@&lt;![\s\S]*?--[ \t\n\r]*&gt;@' // Strip multi-line comments including CDATA ); $contents = preg_replace($search, '', $contents); $result = array_count_values( str_word_count( strip_tags($contents), 1 ) ); print_r($result); </code></pre>