Sort a complex associative array in PHP -


this question has answer here:

i have associative array in php like:

    $newarray1 = array (     [producta] => array (         [link] => http://sanjosespartan.com/blog/products/agile-java-development/         [visitcount] => 4         )     [productd] => array (         [link] => http://sanjosespartan.com/blog/products/intro-to-go/         [visitcount] => 1         )     [productg] => array (         [link] => http://sanjosespartan.com/blog/products/node-js-for-developers/         [visitcount] => 1         )     [productb] => array (         [link] => http://sanjosespartan.com/blog/products/beginning-mysql/         [visitcount] => 1         )     [productc] => array (         [link] => http://sanjosespartan.com/blog/products/computer-networks/         [visitcount] => 1         )     [productf] => array (         [link] => http://sanjosespartan.com/blog/products/mongo-database/         [visitcount] => 1         )     [producth] => array (         [link] => http://sanjosespartan.com/blog/products/python/         [visitcount] => 1         )     [producti] => array (         [link] => http://sanjosespartan.com/blog/string-theory/         [visitcount] => 1         )     [productj] => array (         [link] => http://sanjosespartan.com/blog/tcs/         [visitcount] => 1         )     [producte] => array (         [link] => http://sanjosespartan.com/blog/products/java-complete-refrence/         [visitcount] => 2         ) ) 

now need sort entire array based on visit count. tried using arsort did not work.

there's lot of answers this. 1 :

https://stackoverflow.com/a/16788610/4632883

look harder before posting !


Comments

Post a Comment

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -