Well, yeah, as it seems, I have difficulties in explaining things in English. Sorry about that.
By "largest possible rectangle" I meant the largest rectangle by area.
So, with
$array = array(3, 5, 3, 1, 7);
the area would be 3*3 = 9 from the first 3 elements of the array.
Edit: I thought of looping it and finding out all different areas, which are interpreted as rectangles, but it would take forever if you have several thousands of vertical lines with their vertical length being maximally 100. I was wondering, if it is possible to develop a quicker solution for this kind of a problem and if is, then what do you suggest me to do?