phptutorials

PHP Script to find Largest & Smallest value in an array without using loop.

These kind of question are asked many time in Interviews to confuse the candidates. It’s actually much easier than using loops.

So how to find the largest and smallest value in an array without using loop?

It’s very simple, we have min() and max() functions already available in PHP itself, min() returns smallest value and max() returns largest value. Using these function I have written an example script below just go through it.

Enjoy the day.

Related Posts

Leave a Reply