Php Json Javascript Array Sort Function In Python