Before somedays , I was working on sorting issue. I was using usort function. In this function, you can define sort criteria. Here you can send 2 variable as parameter , then write ascending or descending or any criteria .
I was using this and I had multi-dimensional array . Thats why, I was writing in the body part of the usort like following
$a[0] > $b[0]
And this way, It is working fine.
But When I using a variable instead of hard code ’0′ like following
$index = 0;
$a[$index] > $b[$index]
It is not working. It is not accepting variable here.
Then I was trying to use ‘create_function()’ where i was using variable and thats work really fine
Thanks