I want to search through my subscriptions and finde the one contain a specific content.
My code looks like this, but it takes from 8-11 seconds to run just the line with GetDataArray.
- Code: Select all
$tname = 'Subscriber';
$GetAll = $tname.'_GetAll';
$GetAllResult = $tname.'_GetAllResult';
$Handle = $tname.'Handle';
$subscriberHandles = $client->$GetAll()->$GetAllResult->$Handle;
$subscriberDataObjects = $client->Subscriber_GetDataArray(array('entityHandles' => $subscriberHandles))->Subscriber_GetDataArrayResult->SubscriberData;
foreach ($subscriberDataObjects as $i => $subscriberData) {
if (strpos($subscriberData->ExtraTextForInvoice, $domain) !== false) {
return $subscriberData->DebtorHandle->Number;
}
}
return false;
What can I do to optimize this piece of code?
(Currently the array size is 250)

