Pillaring of layered zirconium and titanium phosphates