Php Iterate Over Key Value Javascript Function How To Use