Php Json Javascript Array Sort Function