Guest User

Untitled

a guest
Jul 15th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. $a = [40, [194, [23, 234, 500], 57], 93, 39, [10, 333, 49]];
  2. $max = 0;
  3. foreach ($a as $b) {
  4. if (is_array($b)) {
  5. foreach ($b as $c) {
  6. if (is_array($c)) {
  7. foreach ($c as $d) {
  8. $max = $d > $max ? $d : $max;
  9. }
  10. } else {
  11. $max = $c > $max ? $c : $max;
  12. }
  13. }
  14. } else {
  15. $max = $b > $max ? $b : $max;
  16. }
  17. }
  18. return $max;
Add Comment
Please, Sign In to add comment