The liver fluke is a flatworm and belongs to the phylum Platyhelminthes (flatworms). Filarial worm is a roundworm (Nematoda), Hirudinaria is a leech (Annelida), and Pheretima is an earthworm (Annelida). Therefore, among the options, only the liver fluke is a flatworm.