- json_encode: documentation ( source)
- array_walk: documentation ( source)
<?php
$input = [
[25,24,23,22,21],
[20,19,18,17,16],
[15,14,13,12,11],
[10, 9, 8, 7, 6],
[ 5, 4, 3, 2, 1]
];
array_walk($input, 'sort');
echo json_encode($input);