PHP - To remove repeated words in the given input
by barkkathulla[ Edit ] 2014-10-11 15:04:20
PHP - How to Remove repeated words in the given string?
<?php
$input_text="its impressive thought.... nice thought";
$filtered_text=preg_replace('/(w{2,})(?=.*?\1)W*/', '',$input_text);
echo $filtered_text;
?>
Output:
its impressive nice thought