Is there a function in php to remove the duplicate string variables, for example there is "abcd,ab,cd,abc,abc", how to change it to "abcd,ab,cd,abc"?thanks.
michael123
0
Junior Poster in Training
Recommended Answers
Jump to PostStraight from PHP.net regarding array_unique:
array_unique
(PHP 4 >= 4.0.1, PHP 5)
array_unique …
Jump to PostIs there a function in php to remove the duplicate string variables, for example there is "abcd,ab,cd,abc,abc", how to change it to "abcd,ab,cd,abc"?thanks.
To make it a bit clearer, heres the custom function.
// removes duplicate substrings between the seperator function uniqueStrs($seperator, $str) { // convert string …
All 6 Replies
michael123
0
Junior Poster in Training
fsn812
29
Junior Poster in Training
digital-ether
399
Nearly a Posting Virtuoso
Team Colleague
fsn812
29
Junior Poster in Training
scandalouskk
-3
Newbie Poster
ShawnCplus
456
Code Monkey
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.