You'd have an object called ... well, you can't call it class ... and that would contain an array (or some sort of iterator, or some sort of list) of students, and methods for manipulating the whole group. As an array, it would be the usual iterate over the array thing. Consider that "a list of all your male student objects" isn't anything to do with a particular student, so it wouldn't be part of the student object (there would need to be a property of each student that says whether they're male of course).
Say there is an object called $homeEconomics and it contains an array $students of student objects. Each $student has a property "gender" which can contain "male" or "female" (or whatever).
Have a method in the class:
function maleStudents()
{
$maleStudents = array();
foreach($this->students as $student)
if($student->gender=='male')
$maleStudents[]=$student;
return $maleStudents;
}
More fundamentally (and therefore more abstractedly, which therefore means you need to think harder about why you'd need it) some frameworks provide a data access framework (Microsoft's ADO.NET is the first that springs to mind because I'm battling with it right now, but have a look at PHP's PDO framework). They provide generic data access objects and leave you to subclass them with the functionality that you need for the particular application.
As NogDog pointed out, OOP comes into play when you're considering the big picture: any individual specific instance could be done without OOP and there'd be no problems. The problems would come when all these individual specific instances that were implemented separately without OOP have to be put together. (I'm generating a report from stuff in the database. The output might be wanted as XHTML, a spreadsheet, a PDF, as an XML document; the user interface might be Ajax, Java, Flash, XUL, or whatever. Oh, and did I mention that I might get the data in three or four different formats? What I need is to put all the different "user interface", "generate output" and "consume input" routines into separate units and be able to just pass a "ui" object, "generator" object and "consumer" object around in my application and ask them to do their stuff without having to care about what they actually do to achieve those tasks.)