iwpg Posted February 7, 2014 Share Posted February 7, 2014 Hello, I am having issues assigning an array value to a variable. Simple enough, I get $bidStrategy with a value of MANUAL_CPC fine, however the $bid variable is too complex for me. Thank you! I hate to ask and don't want to cheat, but does anyone know of a tool that will give you these variables from an array? I have a lot of this going on in the code that I need to solve with little time to dedicate. foreach ($page->entries as $adGroupCriterion) { $bidStrategy = $adGroupCriterion->biddingStrategyConfiguration->biddingStrategyType; $bid = $adGroupCriterion->biddingStrategyConfiguration->bids->CpcBid->bid->Money->microAmount; } The Array: [biddingStrategyConfiguration] => BiddingStrategyConfiguration Object ( [biddingStrategyType] => MANUAL_CPC [biddingScheme] => ManualCpcBiddingScheme Object ( [enhancedCpcEnabled] => [BiddingSchemeType] => ManualCpcBiddingScheme [_parameterMap:BiddingScheme:private] => Array ( [BiddingScheme.Type] => BiddingSchemeType ) ) [bids] => Array ( [0] => CpcBid Object ( [bid] => Money Object ( [microAmount] => 3500000 [ComparableValueType] => Money [_parameterMap:ComparableValue:private] => Array ( [ComparableValue.Type] => ComparableValueType ) ) [contentBid] => [cpcBidSource] => ADGROUP [BidsType] => CpcBid [_parameterMap:Bids:private] => Array ( [Bids.Type] => BidsType ) ) ) ) Quote Link to comment https://forums.phpfreaks.com/topic/286007-array-variable-select/ Share on other sites More sharing options...
requinix Posted February 7, 2014 Share Posted February 7, 2014 ->bids is an array, ->bids[0] is a CpcBid object, and ->bids[0]->bid is a Money object. $adGroupCriterion->biddingStrategyConfiguration->bids[0]->bid->microAmount Quote Link to comment https://forums.phpfreaks.com/topic/286007-array-variable-select/#findComment-1468010 Share on other sites More sharing options...
iwpg Posted February 7, 2014 Author Share Posted February 7, 2014 Thank you requinix! I'm starting to get the picture! I appreciate the help. Quote Link to comment https://forums.phpfreaks.com/topic/286007-array-variable-select/#findComment-1468080 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.