<?php $txt = 'un texto con mc2 <-- cut the text to this-->mc2 @'; $ra = array('mc1','mc2','mc3','@'); $rb = array('cut1','cut2','cut3','~• ~• ~• ~• 0'); $str = str_replace($ra,$rb,$txt); echo $str; ?>