Possible Duplicate:
remove duplicate from string in PHP
How to detect and remove duplicate content ignoring recurring " "
-s with PHP?
I have the following string:
razor989 alcatraz artez tajemniczyxd mrrazor qwertyuiop pomroczny4 omgdmg great_jojek maciekcz242 kaka2610 teleskop1 supciokawa klocek18 kacpi999 pawel1909 pozbierany kelthuzan istrim groch mario alcatraz
Please try
$str = 'your string';
$ar = explode('
', $str);
$ar = array_unique($ar);
echo implode('
', $ar); //edited - original code had $arr
Make it a unique array:
$massiveString = '
razor989
alcatraz
artez
tajemniczyxd
mrrazor
qwertyuiop
pomroczny4
omgdmg
great_jojek
maciekcz242
kaka2610
teleskop1
supciokawa
klocek18
kacpi999
pawel1909
pozbierany
kelthuzan
istrim
groch
mario
alcatraz
';
echo implode('
', array_unique(explode('
', $massiveString)));