I want to shorten the array, so it only contains 30 elements. If, for example, I have an array of 100 elements, can I take it and cut (as they say) 70 of these elements?
Use array_slice to extract the range of elements needed.
array_slice
$short_array = array_slice($my_big_array, 0, 30)
$short_array will have the first 30 elements of $my_big_array
$short_array
$my_big_array
http://php.net/manual/en/function.array-slice.php
Using:
$shortarray = array_slice($longarray, 0, 30);