Write a PHP program to remove duplicates from a sorted list


Introduction

PHP is a server scripting language, and It is a powerful tool for making interactive and dynamic Web-pages. I have used WampServer 2.2 for following excercise..


techstudy.org

HP 15 Core i3 7th gen Laptop(4GB, 1TB HDD, Windows 10) | Rs. 31,490

  1. <?php
  2. function remove_duplicates_list($list1) {
  3. $nums_unique = array_values(array_unique($list1));
  4. return $nums_unique ;
  5. }
  6. $nums = array(2,3,4,5,1,2,3,4);
  7. print_r(remove_duplicates_list($nums));
  8. ?>

Result

python language techstudy.org

     





Related Topics




Popular Posts