How to find the shortest side of the box in php?

In this post, we helps you find the shortest side of the box in php.

1. Code:

   <?php 
    function getShortestSideOfTheBox($width, $height, $length){
		$dim = array($width, $height, $length);
		sort($dim);
		return $dim[0];
	}
    echo getShortestSideOfTheBox(12, 3, 18);
    ?> 

2. Example:

Input:

input: 12, 3, 8

Output:

output: 3