- Make an array with random integer elements.
- Sort it an ascending order
- Print top value using array_slice function.
<?php $arr = array ( 11, 53, 14, 2, 41, 5, 10, 17, 60, 28, 0 ); rsort($arr); $top_elements = array_slice($a, 0, 5); print_r($top_elements); ?>
Hello, My Name is pradip parker . I am a Web Developer, Professional Blogger from India. i love and like web designing and developing, i have two year of experience in programming and developing I am the founder of programmingconcept. I started this blog in 2017 to for help developers by providing easy,small and best tutorials.