Phosphate can be precipitated from wastewater effluent by forming a slow release fertilizer called struvite. Old technology.
Interesting piece on Slate.com that dives into the importance of
fertilizers, and a European toilet designed to recycle phosphorus:
So even though the phosphorus atoms never disappear, they're not available
as fertilizer. The world has between 4 billion and 8 billion tons of
phosphate reserves, and we extract one-eighth of a billion tons per year.
So simple arithmetic says we could "run out" of phosphorus in about 30
years. The end could come even sooner if we ramp up biofuel production,
since switchgrass, corn, and other biofuel crops will require loads of
phosphorus-rich fertilizer. And unlike nitrogen, there's no other ready
source than mining.
What can we do? There's scrimping, of course, but humans almost never do
that well, (See peak oil.) We prefer technical solutions. One promising
strategy calls for recycling P. And the easiest way to do so is to recycle
pee—through a European technology called NoMix toilets...