How to remove duplicate values from Array in PHP?By Hardik Savani | July 14, 2016 | | 2828 Viewer | Category : PHP
It is pretty simple to delete duplicate values from PHP Array. But sometimes we confuse for how can we remove. But PHP provide pre-define function array_unique that can help to remove duplicate values from Array.
array_unique() through we can get only unique value from array. So, you can see bellow example i have 34 value two times but when i use array_unique() then it will return only unique value as bellow output:
$myArray = [11,34,56,78,34];
$myArrayNew = array_unique($myArray);
 => 11
 => 34
 => 56
 => 78
- Bootstrap star rating example using bootstrap-star-rating plugin
- Ckeditor required field validation example in Jquery
- Simple Highcharts Chart Example using PHP MySQL Database
- How to increase upload file size limit PHP in Ubuntu?
- How to add custom jquery validation for image file upload in summernote ?
- How to uninstall cordova and ionic in ubuntu
- PHP - How to custom file uploading with CKEDITOR?
- How to get last inserted id in Codeigniter?