potresti memorizzare l'array in maniera differente:

$MYFILE[$record] = array($i, $mydata, $mysize);

e poi usare un ksort($MYFILE);