htcilt
01-26-2010, 05:21 PM
Hi,
Is there a function to remove repetitions of a string within another string?
I know strpos() can be used to test if there is a match, and substr_count can be used to count the number of repetitions, but I cant find anything to delete the repetitions.
For example:
$haystack = "hello world, 123, hello world";
should read:
hello world, 123
Is there a function to remove repetitions of a string within another string?
I know strpos() can be used to test if there is a match, and substr_count can be used to count the number of repetitions, but I cant find anything to delete the repetitions.
For example:
$haystack = "hello world, 123, hello world";
should read:
hello world, 123