Php Iterate Over Key Value Javascript Array Find Index