usort in php

Solutions on MaxInterview for usort in php by the best coders in the world

showing results for - "usort in php"
Lara
19 Jan 2020
1
2<?php
3
4 function my_sort($a,$b)
5{
6if ($a==$b) return 0;
7return ($a<$b)?-1:1;
8}
9
10$a=array(4,2,8,6);
11usort($a,"my_sort");
12?>
13