How can I remove duplicate values from an array in PHP?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
That's a great way to do it. Might want to make sure its output is back an array again. Now you're only showing the last unique value.
Try this:
Use array_unique().
Example:
Use
array_values(array_unique($array));
array_unique
: for unique arrayarray_values
: for reindexingWe can create such type of array to use this last value will be updated into column or key value and we will get unique value from the array...
The only thing which worked for me is: