Skip to content
Advertisement

php remove duplicate except original

this is my code

JavaScript

display

JavaScript

i want like this

JavaScript

i want to keep one… please help me, thanks guys

Advertisement

Answer

This code resorts to checking each line to see if it matches your $unwanted string, but it also creates an array of strings it has already encountered so it checks if it has previously been encountered ( using in_array()). If it matches and has been encountered before it uses unset() in the original $rows to remove the line…

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement