Michdd Posted October 16, 2008 Share Posted October 16, 2008 Is it possible, or is there some function that will delete duplicates of a set string? Like if I have: $string = "abcabcabcabcabc"; And I want to get rid of all duplicates, so it will make it: "abc" by deleting all duplicates. But where I can give it the parameters for what the duplicate is. Link to comment https://forums.phpfreaks.com/topic/128762-deleting-duplicates-within-a-string/ Share on other sites More sharing options...
prexep Posted October 16, 2008 Share Posted October 16, 2008 Do you just want that one string or will there be different inputs that will need the duplications taken out? Link to comment https://forums.phpfreaks.com/topic/128762-deleting-duplicates-within-a-string/#findComment-667402 Share on other sites More sharing options...
Michdd Posted October 16, 2008 Author Share Posted October 16, 2008 Do you just want that one string or will there be different inputs that will need the duplications taken out? Different inputs. Link to comment https://forums.phpfreaks.com/topic/128762-deleting-duplicates-within-a-string/#findComment-667403 Share on other sites More sharing options...
discomatt Posted October 17, 2008 Share Posted October 17, 2008 This is impossible without more specific direction... otherwise 'abcbdef' might be turned into 'acdef'.. which isn't what you want to accomplish as far as i know. Link to comment https://forums.phpfreaks.com/topic/128762-deleting-duplicates-within-a-string/#findComment-667683 Share on other sites More sharing options...
effigy Posted October 17, 2008 Share Posted October 17, 2008 Do they have to be consecutive? Link to comment https://forums.phpfreaks.com/topic/128762-deleting-duplicates-within-a-string/#findComment-667980 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.