removing of duplicated values
I want to loop the values inside of php array and check to my html if its duplicated or not. when values is greater than to one, I want the other duplicate values to be removed.
- <script type="text/javascript">
-
- var jQueryArray = <?php echo json_encode($arrayForDeposit); ?>
-
- for ( var i = 0; i < jQueryArray.length; i = i + 1 ) {
- var item = jQueryArray[ i ]
- var $div = $('td .forDeposit:contains(item)');
-
- // console.log($div)
- if ($div.length > 1) {
- $div.not(':last').remove()
- }
- }
- </script>