This post describes how to remove an element of an associative array with Unset i.e unset($array['key1']);
I have this array:
Array
(
[queryLocator] =>
[done] => 1
[records] => Array
(
[0] => stdClass Object
(
[Id] =>
[CreatedDate] => 2016-08-28T14:43:45.000Z
[Leader__c] => GF
[Location__c] => Postbridge
[Service_Date__c] => 2016-09-03
[Service_Time__c] => 14:30
[Service_Type__c] => Baptism
)
)
[size] => 42
[pointer] => 0
[QueryResultsf] => SforceEnterpriseClient Object
(
[sforce:protected] => SoapClient Object
(
[trace] => 1
[compression] => 32
[_encoding] => utf-8
[_features] => 1
[_user_agent] => salesforce-toolkit-php/20.0
[_soap_version] => 1
[sdl] => Resource id #8
[packageVersionHeader:protected] =>
[client_id:protected] =>
)
) )
I want to delete the key [queryLocator], replace the key [done] with [total], replace the key [records] with [rows] and delete all subsequent keys i.e [size], [pointer] etc.
Using unset, i.e unset($array['queryLocator']); has no effect.
What am I doing wrong ? Thanks.