<?php
//Собственно, задача, дан массив чисел, найдите 2 наибольших. Решать можно на JS или PHP, кому что роднее.
$numbers = array(1, 500, 500, 500, 500, 2, 3, 4, 5, 22, 12, 12, 123, 52, 24); function top2numbers
(array $numbers) {
sort($numbers, SORT_NUMERIC
); return $top;
}
PD9waHAKLy/QodC+0LHRgdGC0LLQtdC90L3Qviwg0LfQsNC00LDRh9CwLCDQtNCw0L0g0LzQsNGB0YHQuNCyINGH0LjRgdC10LssINC90LDQudC00LjRgtC1IDIg0L3QsNC40LHQvtC70YzRiNC40YUuINCg0LXRiNCw0YLRjCDQvNC+0LbQvdC+INC90LAgSlMg0LjQu9C4IFBIUCwg0LrQvtC80YMg0YfRgtC+INGA0L7QtNC90LXQtS4KJG51bWJlcnMgPSBhcnJheSgxLCA1MDAsIDUwMCwgNTAwLCA1MDAsIDIsIDMsIDQsIDUsIDIyLCAxMiwgMTIsIDEyMywgNTIsIDI0KTsKZnVuY3Rpb24gdG9wMm51bWJlcnMgKGFycmF5ICRudW1iZXJzKQp7CiAgICBzb3J0KCRudW1iZXJzLCBTT1JUX05VTUVSSUMpOwogICAgJHRvcCA9IGFycmF5X3NsaWNlKCRudW1iZXJzLCAtMik7CiAgICByZXR1cm4gJHRvcDsKfQpwcmludF9yKHRvcDJudW1iZXJzKCRudW1iZXJzKSk7