Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

sorting sql query array by column key php

//Sorting $Content array by page_order column key in ascending order
array_multisort(array_column($Content, "page_order"), SORT_ASC, $Content);
//Sorting $Content array by id in ascending order
array_multisort(array_column($Content, "id"), SORT_ASC, $Content);
 
PREVIOUS NEXT
Tagged: #sorting #sql #query #array #column #key #php
ADD COMMENT
Topic
Name
9+4 =