When I use the sort function in php, it removes all keys. What is an alternative method?
I think the asort function is what you are looking for.
You want to use asortinstead sort, which keeps your key associations unchanged:
asort
sort
http://php.net/asort
asort - sort an array and maintain index association . This is probably what you are looking for.
Source: https://habr.com/ru/post/1732258/More articles:Security in the Grails-app: Acegi or Shiro - authenticationWCF: Is it safe to create an asynchronous workflow on the server? - asynchronousDatamapper (ruby) - (Using the sample blog) Retrieving posts without comments - ruby | fooobar.comCommunication Error Message - coldfusionкак получить значение отношения в form_builder в rails - ruby-on-railsProblem Posting a MIME-encoded application to the Ariba vendor network - postAnnounce which signals subscribe to DBus? - pythonWhere do the build tools go in the source tree? - version-controlPyQt beginremoverows - pythonHow to draw a slightly diagonal gradient Fill in PHP? - phpAll Articles