Templated preparation of porous magnetic microspheres and their application in removal of cationic dyes from wastewater.