Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $a = [40, [194, [23, 234, 500], 57], 93, 39, [10, 333, 49]];
- $max = 0;
- foreach ($a as $b) {
- if (is_array($b)) {
- foreach ($b as $c) {
- if (is_array($c)) {
- foreach ($c as $d) {
- $max = $d > $max ? $d : $max;
- }
- } else {
- $max = $c > $max ? $c : $max;
- }
- }
- } else {
- $max = $b > $max ? $b : $max;
- }
- }
- return $max;
Add Comment
Please, Sign In to add comment