General methods for obtaining phosphates