guarda queste due fnzioni:
http://it2.php.net/manual/it/function.strpos.php
http://it2.php.net/manual/it/function.str-replace.php

ciao