<?php
//...
$tags = $api->photos_search(array(
'text' => 'stuff',
));
foreach ($tags['photo'] as $photo) {
// want to get get the user's actual username from the the "owner"
$ownerId = $photo['owner'];
// getUsernameById($ownerId); // <-- how do you do this?
}