metti il testo in una stringa e usi

http://it2.php.net/manual/it/function.explode.php

ciao
sergio