actually not true, modern phones use SSD, and don't really get affected by magnets in the way you might expect.
Generally most of the damage caused by strong external magnetic fields to any electronics are caused by second order effects, i.e. something gets confused and causes data-destroying failure.