Jump to content

[SOLVED] Help Parsing Array


RIRedinPA

Recommended Posts

Hi folks:

 

Arrays are an Achilles heel for me. Can anyone help me out parsing this one? I am trying to get the CustomFieldDetails data out.

 


array (
  'RetrieveResult' => 
  array (
    'CvObject' => 
    array (
      'CustomFieldDetail' => 
      array (
        0 => 
        array (
          '!FieldName' => 'Website',
          '!FieldType' => 'Open Ended Text - One Line',
          '!FieldValue' => 'www.xxxxxxxx.com',
          '!FieldId' => 'BF5557E3-5A53-4A29-9003-F31092AD0B1C',
        ),
        1 => 
        array (
          '!FieldName' => 'Department / Division',
          '!FieldType' => 'Open Ended Text - One Line',
          '!FieldValue' => '',
          '!FieldId' => '3E8FB55D-E901-46DA-9E5A-56785E1C949A',
        ),
        2 => 
        array (
          '!FieldName' => 'Password',
          '!FieldType' => 'Open Ended Text - One Line',
          '!FieldValue' => '',
          '!FieldId' => '60BF3480-5447-46F0-B4AA-C0D577CBB1EC',
        ),
        3 => 
        array (
          '!FieldName' => 'Member Status',
          '!FieldType' => 'Choice - Single Answer (Horizontal)',
          '!FieldValue' => 'yes',
          '!FieldId' => 'B8D6ED73-5BD9-487C-BB1F-7C271DF7C943',
        ),
        4 => 
        array (
          '!FieldName' => 'Member Price',
          '!FieldType' => 'Choice - Single Answer (Horizontal)',
          '!FieldValue' => 'Sustaining/$1000',
          '!FieldId' => '4F2559C5-D249-419E-AA85-73518C1EC283',
        ),
        5 => 
        array (
          '!FieldName' => 'Lead/Alt',
          '!FieldType' => 'Choice - Single Answer (Horizontal)',
          '!FieldValue' => '',
          '!FieldId' => 'AACE4F76-FCF1-46BC-BDBC-5BF68B7F018E',
        ),
        6 => 
        array (
          '!FieldName' => 'Renewal Date',
          '!FieldType' => 'Open Ended Text - Date/Time',
          '!FieldValue' => '1/10/2009',
          '!FieldId' => '59A410C7-A2B2-471E-BBEB-DAA63779C39F',
        ),
        7 => 
        array (
          '!FieldName' => 'Member Since',
          '!FieldType' => 'Open Ended Text - Date/Time',
          '!FieldValue' => '',
          '!FieldId' => '8A360979-B38D-4263-BFFD-78E2E250EE64',
        ),
        8 => 
        array (
          '!FieldName' => 'NetNews',
          '!FieldType' => 'Choice - Single Answer (Horizontal)',
          '!FieldValue' => 'yes',
          '!FieldId' => 'F521BE9F-3FF5-455B-ADA2-9B51D09211D5',
        ),
        9 => 
        array (
          '!FieldName' => 'Member Type',
          '!FieldType' => 'Choice - Single Answer (Drop-Down)',
          '!FieldValue' => 'Funds',
          '!FieldId' => '36213AFE-EFCA-40BC-A763-048B4BABA062',
        ),
        10 => 
        array (
          '!FieldName' => 'Assistant Name',
          '!FieldType' => 'Open Ended Text - One Line',
          '!FieldValue' => '',
          '!FieldId' => '46B15FCE-350B-47DE-B308-5EFACCEA418B',
        ),
        11 => 
        array (
          '!FieldName' => 'Assistant Phone',
          '!FieldType' => 'Open Ended Text - One Line',
          '!FieldValue' => '',
          '!FieldId' => 'C5B3BE69-EBD7-4C12-BE72-544630604013',
        ),
        12 => 
        array (
          '!FieldName' => 'Assistant Email',
          '!FieldType' => 'Open Ended Text - One Line',
          '!FieldValue' => '[email protected]',
          '!FieldId' => '85E04A46-907F-4158-B037-6E64DC343514',
        ),
        13 => 
        array (
          '!FieldName' => 'Company Description',
          '!FieldType' => 'Open Ended Text - One Line',
          '!FieldValue' => '',
          '!FieldId' => 'E84DC0A3-4AF7-4A47-9894-32636C215C3F',
        ),
        14 => 
        array (
          '!FieldName' => 'Company Logo',
          '!FieldType' => 'Open Ended Text - One Line',
          '!FieldValue' => '',
          '!FieldId' => 'D785B1B0-5CCE-40BA-9D25-34C22411A911',
        ),
        15 => 
        array (
          '!FieldName' => 'Member Spotlight',
          '!FieldType' => 'Open Ended Text - Date/Time',
          '!FieldValue' => '',
          '!FieldId' => '626DFCC8-7E14-41F8-962F-6E3E3CADA977',
        ),
        16 => 
        array (
          '!FieldName' => 'Conference, 2009',
          '!FieldType' => 'Choice - Single Answer (Horizontal)',
          '!FieldValue' => '',
          '!FieldId' => '64BD4511-70DD-4284-BF42-AA8335C8822B',
        ),
        17 => 
        array (
          '!FieldName' => 'Referred By',
          '!FieldType' => 'Open Ended Text - One Line',
          '!FieldValue' => '',
          '!FieldId' => '244AB094-DD28-438C-8534-37FA6E145EC8',
        ),
      ),
      'ContactGroupDetail' => 
      array (
        0 => 
        array (
          '!GroupName' => 'XXXXX Members',
          '!GroupId' => '727203F0-AE36-4E02-955C-840CE3BED60A',
        ),
        1 => 
        array (
          '!GroupName' => 'allContacts',
          '!GroupId' => 'F138CF41-E9B6-429F-81D9-8E7C2E0E5E58',
        ),
        2 => 
        array (
          '!GroupName' => 'NetNews',
          '!GroupId' => '106A7E44-9EB4-42A8-9456-EF753A6BA13B',
        ),
      ),
      '!Id' => '95E0E5DF-6241-4092-A080-2897460B41F7',
      '!SourceId' => '',
      '!FirstName' => 'Jweewewe',
      '!LastName' => 'Cdddsdsd',
      '!EmailAddress' => '[email protected]',
      '!CCEmailAddress' => '',
      '!Company' => 'xxxx xxx xxxx',
      '!Title' => 'Vice President',
      '!ContactType' => '',
      '!ContactTypeCode' => '',
      '!Salutation' => 'Mr.',
      '!Nickname' => 'xxxx',
      '!MiddleName' => 'W.',
      '!Designation' => '',
      '!ExcludedFromEmail' => 'false',
      '!CreatedDate' => '2009-05-31T15:01:07.12',
      '!CreatedBy' => 'Import:nasvfDELETED.txt',
      '!LastModifiedDate' => '2009-06-13T09:30:46.077',
      '!LastModifiedBy' => 'Import:nasvfDELETED.txt',
      '!EmailAddressStatus' => 'Email Sent',
      '!LogReason' => '',
      '!LogResponse' => '',
      '!HomeAddress1' => '',
      '!HomeAddress2' => '',
      '!HomeAddress3' => '',
      '!HomeCity' => '',
      '!HomeState' => ' ',
      '!HomeStateCode' => '',
      '!HomePostalCode' => '',
      '!HomeCountry' => '',
      '!HomeCountryCode' => '',
      '!HomePhone' => '',
      '!HomeFax' => '',
      '!WorkAddress1' => '#### Forsyth Blvd',
      '!WorkAddress2' => 'Suite ####',
      '!WorkAddress3' => '',
      '!WorkCity' => 'SomeCity',
      '!WorkState' => 'Somestate',
      '!WorkStateCode' => 'SS',
      '!WorkPostalCode' => '####',
      '!WorkCountry' => 'USA',
      '!WorkCountryCode' => 'US',
      '!WorkPhone' => '###-###-####',
      '!WorkFax' => '###-###-####',
      '!MobilePhone' => '',
      '!Pager' => '',
    ),
  ),
)

Link to comment
https://forums.phpfreaks.com/topic/162703-solved-help-parsing-array/
Share on other sites

Let's say that array is stored in the variable $e.

$custom_fields = $e['RetrieveResult']['CvObject']['CustomFieldDetail'];

 

I've tried that and get nothing when I do print count($

Let's say that array is stored in the variable $e.

$custom_fields = $e['RetrieveResult']['CvObject']['CustomFieldDetail'];

['RetrieveResult']['CvObject']['CustomFieldDetail']

 

Thanks.

 

$website = $e['RetrieveResult']['CvObject']['CustomFieldDetail']['0']['!FieldValue'];

print website;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.