How to find the longest side of the box in php?
In this post, we helps you find the longest side of the box in php.
1. Code:
<?php function getLongestSideOfTheBox($width, $height, $length){ $dim = array($width, $height, $length); sort($dim); return $dim[2]; } echo getLongestSideOfTheBox(12, 3, 18); ?>
2. Example:
Input:
input: 12, 3, 8
Output:
Output: 12