http://docs.phpvms.net/development/searching_schedules_and_pireps
The doc isn't finished, but the same premise for PIREPS, using the search interface. It will return all the data about a PIREP for whichever parameters you pass.
You can see the query and the fields returned:
http://bugs.phpvms.net/browser/trunk/core/common/PIREPData.class.php#L44
So you can search by the fields by putting them in an array:
<?php
$params = array(
'aircraftid' => [iD],
// or you can do:
'registration' => [registration],
);
// Just set the sort order to the last one
// save the old value
$old_sort_order = Config::Get('PIREPS_ORDER_BY');
Config::Set('PIREPS_ORDER_BY', 'submitdate DESC');
// Now find the PIREPS, retrieve one
$pirep = PIREPData::findPIREPS($params, 1);
$pirep = $pirep[0];
// And reset the sort order to our setting:
Config::Set('PIREPS_ORDER_BY', $old_sort_order);