sortCodice PHP:function compareNumbers(a, b) {
if(a[0] > b[0])
return 1;
if(a[0] < b[0])
return -1;
return 0;
}
var pippo= [[1,'P','primo'],[3,'D','secondo'],[10,'A','terzo'],[7,'C','quarto']]; //array originale
alert(pippo.sort(compareNumbers));
![]()
sortCodice PHP:function compareNumbers(a, b) {
if(a[0] > b[0])
return 1;
if(a[0] < b[0])
return -1;
return 0;
}
var pippo= [[1,'P','primo'],[3,'D','secondo'],[10,'A','terzo'],[7,'C','quarto']]; //array originale
alert(pippo.sort(compareNumbers));
![]()
Without faith, nothing is possible. With it, nothing is impossible
http://ilwebdifabio.it