<?php echo max(1, 3, 5, 6, 7); // 7 echo max(array(2, 4, 5)); // 5
echo max(0, 'bonjour'); // 0 echo max('bonjour', 0); // bonjour echo max(-1, 'bonjour'); // bonjour
// Avec plusieurs tableaux, min() fait les comparaisons de gauche à droite // dans notre exemple : 2 == 2, mais 4 < 5 $val = max(array(2, 4, 8), array(2, 5, 7)); // array(2, 5, 7)
// Si un mélange de tableau et de scalaires sont fournis, // le tableau est toujours retourné, car il est considéré comme le plus grand $val = max('string', array(2, 5, 7), 42); // array(2, 5, 7) ?>
|