Hello to all! There is such a code
function cmp($a, $b) { if ( (int)$a < (int)$b ) return -1; if ( (int)$a = (int)$b ) return 0; if ( (int)$a > (int)$b ) return 1; } $s = array(1,1,1,0,0,1,1,1); uasort( $s, cmp );
Produces "Array ([5] => 1 [6] => 1 [7] => 1 [4] => 0 [3] => 0 [1] => 1 [2] => 1 [0] = > 1) "Why does the sorting fail? What cant?
PS Until now, did not go to bed, so that the head tupit. I suspect that the error is somehow obvious, but I can’t catch it anymore, I hope for your attention =)